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