{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/pre-commit-config.json", "definitions": { "meta_repo": { "type": "object", "properties": { "repo": { "default": "meta", "enum": ["meta"] }, "hooks": { "type": "array", "items": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string", "enum": [ "check-hooks-apply", "check-useless-excludes", "identity" ] } } } } } }, "local_repo": { "type": "object", "properties": { "repo": { "default": "local", "description": "A list of local hooks\nhttps://pre-commit.com/#2-add-a-pre-commit-configuration", "enum": ["local"], "type": "string" }, "hooks": { "type": "array", "items": { "$ref": "#/definitions/hook_definition", "type": "object", "required": ["id", "name", "entry", "language"] } } } }, "uri_repo": { "type": "object", "properties": { "repo": { "description": "A repository url\nhttps://pre-commit.com/#2-add-a-pre-commit-configuration", "type": "string", "pattern": "^(?!(?:meta|local)$).*$" }, "rev": { "description": "A revision or tag to clone at\nhttps://pre-commit.com/#2-add-a-pre-commit-configuration", "type": "string" }, "hooks": { "description": "A list of hook mappings\nhttps://pre-commit.com/#pre-commit-configyaml---hooks.", "type": "array", "items": { "$ref": "#/definitions/hook_definition", "type": "object" } } } }, "hook_definition": { "type": "object", "properties": { "id": { "description": "An identifier of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "alias": { "description": "An additional identifier of the current hook for `pre-commit run `\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "name": { "description": "A name of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "language_version": { "description": "A language version of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "files": { "description": "A pattern to include files to run on of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "exclude": { "description": "A pattern to exclude files from `files` to run on of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "types": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/file_types", "description": "A list of file types to run on combined via logical `and` of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks" }, "types_or": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/file_types", "description": "A list of file types to run on combined via logical `or` of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks" }, "exclude_types": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/file_types", "description": "A list of file types to exclude of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks" }, "args": { "description": "List of additional parameters to pass to the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "array", "items": { "type": "string" } }, "stages": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/stages", "description": "A stage of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks" }, "additional_dependencies": { "description": "A list of additional_dependencies of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "array", "items": { "type": "string" } }, "always_run": { "description": "Run the current hook when no files matched\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "boolean" }, "verbose": { "description": "Display an output of the current hook even it passes\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "boolean" }, "entry": { "description": "A command of the current hook\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "string" }, "log_file": { "description": "A log file of the current hook", "type": "string" }, "language": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/language", "description": "A language the current hook is written in\nhttps://pre-commit.com/#pre-commit-configyaml---hooks" }, "pass_filenames": { "description": "Whether to pass filenames to the current hook or not\nhttps://pre-commit.com/#pre-commit-configyaml---hooks", "type": "boolean", "default": true } } } }, "properties": { "ci": { "description": "pre-commit.ci specific settings\nhttps://pre-commit.ci/#configuration", "type": "object", "properties": { "autofix_commit_msg": { "description": "A commit message for pull request autofixes\nhttps://pre-commit.ci/#configuration", "default": "[pre-commit.ci] auto fixes from pre-commit.com hooks\n\nfor more information, see https://pre-commit.ci", "type": "string" }, "autofix_prs": { "description": "Whether to autofix pull requests\nhttps://pre-commit.ci/#configuration", "type": "boolean", "default": true }, "autoupdate_branch": { "description": "A branch to send pull request's autoupdate to\nhttps://pre-commit.ci/#configuration", "type": "string", "default": "" }, "autoupdate_commit_msg": { "description": "A commit message for autoupdate pull requests\nhttps://pre-commit.ci/#configuration", "type": "string", "default": "[pre-commit.ci] pre-commit autoupdate" }, "autoupdate_schedule": { "description": "An autoupdate frequency\nhttps://pre-commit.ci/#configuration", "type": "string", "default": "weekly", "enum": ["weekly", "monthly", "quarterly"] }, "skip": { "description": "List of skipped hook's ids\nhttps://pre-commit.ci/#configuration", "type": "array", "items": { "type": "string" } }, "submodules": { "description": "Whether to recursively check out submodules\nhttps://pre-commit.ci/#configuration", "type": "boolean", "default": false } } }, "repos": { "description": "Repository mappings of the current project\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "array", "items": { "anyOf": [ { "$ref": "#/definitions/meta_repo" }, { "$ref": "#/definitions/local_repo" }, { "$ref": "#/definitions/uri_repo" } ] } }, "default_install_hook_types": { "description": "A list of hook types which will be used by default when running `pre-commit install`\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "array", "default": ["pre-commit"] }, "default_language_version": { "description": "Mappings for the default language versions of the current project\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "object", "additionalProperties": { "type": "string" } }, "default_stages": { "$ref": "https://json.schemastore.org/pre-commit-hooks.json#/definitions/stages", "description": "The default stages of the current project\nhttps://pre-commit.com/#pre-commit-configyaml---top-level" }, "files": { "description": "A file include pattern of the current project\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "string", "default": "" }, "exclude": { "description": "A file exclude pattern of the current project\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "string", "default": "^$" }, "fail_fast": { "description": "Whether stop running hooks after a first failure\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "boolean", "default": false }, "minimum_pre_commit_version": { "description": "A minimum version of pre-commit\nhttps://pre-commit.com/#pre-commit-configyaml---top-level", "type": "string", "default": "0" } }, "required": ["repos"], "title": "JSON schema for .pre-commit-config.yaml", "type": "object" }