Documentation
¶
Overview ¶
Package githooksync implements MDS048, the git-hook-sync rule. It reports when the pre-merge-commit hook or .gitattributes merge driver assignments do not list the same files that currently contain generated-section directives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct{}
Rule checks that mdsmith-managed git hooks and .gitattributes are in sync with the files that contain generated-section directives.
The rule is runnable in its zero value: it has no required runtime settings, so users can opt in via the bool form `git-hook-sync: true`. ApplySettings is still implemented to validate unknown keys when the user provides a mapping, but execution does not depend on it being called.
"At most one diagnostic per repository" is enforced via package- level state rather than per-Rule state, because the engine clones Configurable rules per file when the rule is enabled with a settings mapping (even an empty `{}`). With per-instance state, each clone would re-emit the diagnostic for every file in the repo.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable. The rule has no runtime settings, so this only rejects unknown keys when a user supplies a mapping. The rule executes regardless of whether ApplySettings is invoked, so a bool-only enable (`git-hook-sync: true`) also works.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable.
func (*Rule) EnabledByDefault ¶
EnabledByDefault implements rule.Defaultable.