Documentation
¶
Index ¶
Constants ¶
View Source
const (
PrecommitConfigFile string = ".pre-commit-config.yaml"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchingRule ¶
type MatchingRule struct {
// Path specifies a .pre-commit-config.yaml path pattern, the pattern requires to match all of name, not just a substring.
Path string
// Repos specifies the list of NPM packages to check
Repos map[string]string
}
MatchingRule allows to specifies rules to identify manifest
type MatchingRules ¶
type MatchingRules []MatchingRule
type Precommit ¶
type Precommit struct {
// contains filtered or unexported fields
}
Precommit holds all information needed to generate precommit manifest.
func (Precommit) DiscoverManifests ¶
type Spec ¶
type Spec struct {
// RootDir defines the root directory used to recursively search for npm packages.json
RootDir string `yaml:",omitempty"`
// Ignore allows to specify rule to ignore autodiscovery a specific NPM based on a rule
Ignore MatchingRules `yaml:",omitempty"`
// Only allows to specify rule to only autodiscover manifest for a specific NPM based on a rule
Only MatchingRules `yaml:",omitempty"`
/*
versionfilter provides parameters to specify the version pattern used when generating manifest.
kind - semver
versionfilter of kind `semver` uses semantic versioning as version filtering
pattern accepts one of:
`patch` - patch only update patch version
`minor` - minor only update minor version
`major` - major only update major versions
`a version constraint` such as `>= 1.0.0`
kind - regex
versionfilter of kind `regex` uses regular expression as version filtering
pattern accepts a valid regular expression
example:
“`
versionfilter:
kind: semver
pattern: minor
“`
and its type like regex, semver, or just latest.
*/
VersionFilter version.Filter `yaml:",omitempty"`
// Digest provides parameters to specify if the generated manifest should use a digest instead of the branch or tag.
// This is equivalent to using the [`--freeze`](https://pre-commit.com/#pre-commit-autoupdate) option of precommit
Digest *bool `yaml:",omitempty"`
}
Spec defines the parameters uses to generate the precomit manifests
Click to show internal directories.
Click to hide internal directories.