How to use the nitpick.plugins.hookimpl function in nitpick

To help you get started, we’ve selected a few nitpick examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andreoliwa / nitpick / src / nitpick / plugins / setup_cfg.py View on Github external
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
    """You should return your plugin class here."""
    return SetupCfgPlugin
github andreoliwa / nitpick / src / nitpick / plugins / pre_commit.py View on Github external
@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
github andreoliwa / nitpick / src / nitpick / plugins / pre_commit.py View on Github external
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
    """You should return your plugin class here."""
    return PreCommitPlugin
github andreoliwa / nitpick / src / nitpick / plugins / json.py View on Github external
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
    """You should return your plugin class here."""
    return JSONPlugin
github andreoliwa / nitpick / src / nitpick / plugins / pyproject_toml.py View on Github external
@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
github andreoliwa / nitpick / src / nitpick / plugins / json.py View on Github external
@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
github andreoliwa / nitpick / src / nitpick / plugins / text.py View on Github external
@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
github andreoliwa / nitpick / src / nitpick / plugins / text.py View on Github external
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
    """You should return your plugin class here."""
    return TextPlugin
github andreoliwa / nitpick / src / nitpick / plugins / setup_cfg.py View on Github external
@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
github andreoliwa / nitpick / src / nitpick / plugins / pyproject_toml.py View on Github external
@hookimpl
def plugin_class() -> Type["NitpickPlugin"]:
    """You should return your plugin class here."""
    return PyProjectTomlPlugin