id = "pre-commit" name = "pre-commit" description = "Framework for managing and running multi-language Git hooks." homepage = "https://pre-commit.com" executables = ["pre-commit"] [commands] format = 1 label = "pre-commit" description = "Run hooks, install the Git hook script or update hook versions. Other subcommands and stage-specific ref options are not covered." quality = "ai-draft" base = "fig:pre-commit" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts" license = "MIT" [[commands.subcommand]] path = ["run"] label = "Run hooks" description = "Run configured hooks on staged files, all files or a chosen file list." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts" license = "MIT" [[commands.subcommand.field]] id = "hook" label = "Hook id" description = "Run only this hook; leave empty to run all." type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "all_files" label = "All files" type = "boolean" option = ["--all-files", "-a"] sources = ["fig"] [[commands.subcommand.field]] id = "files" label = "Specific files" type = "path" option = ["--files"] multiple = true path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "show_diff" label = "Show diff on failure" type = "boolean" option = ["--show-diff-on-failure"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["--verbose", "-v"] sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "hook_stage" label = "Hook stage" type = "enum" option = ["--hook-stage"] choices = [{ value = "pre-commit", label = "pre-commit" }, { value = "pre-merge-commit", label = "pre-merge-commit" }, { value = "pre-push", label = "pre-push" }, { value = "prepare-commit-msg", label = "prepare-commit-msg" }, { value = "commit-msg", label = "commit-msg" }, { value = "post-commit", label = "post-commit" }, { value = "post-checkout", label = "post-checkout" }, { value = "post-merge", label = "post-merge" }, { value = "post-rewrite", label = "post-rewrite" }] sources = ["fig"] [[commands.subcommand.task]] id = "all" label = "Run on all files" set = { all_files = [true], show_diff = [true] } fields = ["hook", "all_files", "show_diff", "verbose"] required = [] [[commands.subcommand.task]] id = "staged" label = "Run on staged files" fields = ["hook", "verbose", "show_diff"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["hook", "all_files", "files", "show_diff", "verbose"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["config", "hook_stage"] [[commands.subcommand]] path = ["install"] label = "Install Git hook" description = "Install the pre-commit script into the repository's .git/hooks." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts" license = "MIT" [[commands.subcommand.field]] id = "hook_type" label = "Hook type" type = "enum" option = ["--hook-type", "-t"] choices = [{ value = "pre-commit", label = "pre-commit" }, { value = "pre-merge-commit", label = "pre-merge-commit" }, { value = "pre-push", label = "pre-push" }, { value = "prepare-commit-msg", label = "prepare-commit-msg" }, { value = "commit-msg", label = "commit-msg" }, { value = "post-commit", label = "post-commit" }, { value = "post-checkout", label = "post-checkout" }, { value = "post-merge", label = "post-merge" }, { value = "post-rewrite", label = "post-rewrite" }] sources = ["fig"] [[commands.subcommand.field]] id = "overwrite" label = "Overwrite existing hooks" type = "boolean" option = ["--overwrite", "-f"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "allow_missing" label = "Allow missing config" type = "boolean" option = ["--allow-missing-config"] sources = ["fig"] [[commands.subcommand.task]] id = "install" label = "Install hook" fields = ["hook_type", "overwrite", "config", "allow_missing"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["hook_type", "overwrite", "config", "allow_missing"] [[commands.subcommand]] path = ["autoupdate"] label = "Update hook versions" description = "Update the repos in the config to their latest versions." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts" license = "MIT" [[commands.subcommand.field]] id = "freeze" label = "Freeze to hashes" type = "boolean" option = ["--freeze"] sources = ["fig"] [[commands.subcommand.field]] id = "bleeding_edge" label = "Bleeding edge of master" type = "boolean" option = ["--bleeding-edge"] sources = ["fig"] [[commands.subcommand.field]] id = "repo" label = "Only this repo" type = "string" option = ["--repo"] multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "update" label = "Update" fields = ["freeze", "bleeding_edge", "repo", "config"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["freeze", "bleeding_edge", "repo", "config"]