src/nitpick/plugins/pre_commit.py
def enforce_rules(self) -> Iterator[Fuss]:
        """Enforce rules for the pre-commit hooks."""
        self.actual_yaml = YAMLFormat(path=self.file_path)
        if KEY_REPOS not in self.actual_yaml.as_data:
            # TODO: if the 'repos' key doesn't exist, assume repos are in the root of the .yml file
            #  Having the 'repos' key is not actually a requirement. 'pre-commit-validate-config' works without it.
            yield self.reporter.make_fuss(Violations.NO_ROOT_KEY)
            return

        # Check the root values in the configuration file
        yield from self.warn_missing_different(
            YAMLFormat(data=self.actual_yaml.as_data, ignore_keys=[KEY_REPOS]).compare_with_dictdiffer(
                self.expected_config
            )
        )

        yield from self.enforce_hooks()
Enforce rules for the pre-commit hooks.
Enforce rules for the pre-commit hooks.
Enforce rules for the pre - commit hooks .
def enforce_rules(self) -> Iterator[Fuss]:
        self.actual_yaml = YAMLFormat(path=self.file_path)
        if KEY_REPOS not in self.actual_yaml.as_data:
            yield self.reporter.make_fuss(Violations.NO_ROOT_KEY)
            return
        yield from self.warn_missing_different(
            YAMLFormat(data=self.actual_yaml.as_data, ignore_keys=[KEY_REPOS]).compare_with_dictdiffer(
                self.expected_config
            )
        )
        yield from self.enforce_hooks()
def enforce_rules ( self ) -> Iterator [ Fuss ] : self . actual_yaml = YAMLFormat ( path = self . file_path ) if KEY_REPOS not in self . actual_yaml . as_data : yield self . reporter . make_fuss ( Violations . NO_ROOT_KEY ) return yield from self . warn_missing_different ( YAMLFormat ( data = self . actual_yaml . as_data , ignore_keys = [ KEY_REPOS ] ) . compare_with_dictdiffer ( self . expected_config ) ) yield from self . enforce_hooks ( )
Enforce rules for the pre-commit hooks.
Enforce rules for the pre - commit hooks .
"""Enforce rules for the pre-commit hooks.""" # TODO: if the 'repos' key doesn't exist, assume repos are in the root of the .yml file #  Having the 'repos' key is not actually a requirement. 'pre-commit-validate-config' works without it. # Check the root values in the configuration file
self