config.is_check_enabled

config.is_check_enabled(config, check_name)

Check if a specific check is enabled.

Convenience function to determine if a check should run based on the configuration.

Parameters

config : dict[str, Any]

Full pycmdcheck configuration dictionary.

check_name : str

Name of the check to query.

Returns

: bool

True if the check is enabled, False otherwise.

Examples

>>> config = {"checks": {"metadata": True, "linting": False}}
>>> is_check_enabled(config, "metadata")
True
>>> is_check_enabled(config, "linting")
False
>>> is_check_enabled(config, "unknown")  # Defaults to enabled
True