Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
"""You should return your plugin class here."""
return SetupCfgPlugin
@hookimpl
def handle_config_file( # pylint: disable=unused-argument
config: JsonDict, file_name: str, tags: Set[str]
) -> Optional["NitpickPlugin"]:
"""Handle pre-commit config file."""
return PreCommitPlugin(config) if file_name == TOMLFormat.group_name_for(PreCommitPlugin.file_name) else None
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
"""You should return your plugin class here."""
return PreCommitPlugin
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
"""You should return your plugin class here."""
return JSONPlugin
@hookimpl
def handle_config_file( # pylint: disable=unused-argument
config: JsonDict, file_name: str, tags: Set[str]
) -> Optional["NitpickPlugin"]:
"""Handle pyproject.toml file."""
base_file = PyProjectTomlPlugin(config)
return base_file if file_name == base_file.file_name else None
@hookimpl
def handle_config_file(config: JsonDict, file_name: str, tags: Set[str]) -> Optional["NitpickPlugin"]:
"""Handle JSON files."""
return JSONPlugin(config, file_name) if "json" in tags else None
@hookimpl
def handle_config_file(config: JsonDict, path_from_root: str, tags: Set[str]) -> Optional["NitpickPlugin"]:
"""Handle text files."""
return TextPlugin(config, path_from_root) if "plain-text" in tags else None
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
"""You should return your plugin class here."""
return TextPlugin
@hookimpl
def handle_config_file( # pylint: disable=unused-argument
config: JsonDict, file_name: str, tags: Set[str]
) -> Optional["NitpickPlugin"]:
"""Handle the setup.cfg file."""
return SetupCfgPlugin(config) if file_name == SetupCfgPlugin.file_name else None
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
"""You should return your plugin class here."""
return PyProjectTomlPlugin