{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/lefthook/latest.json",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/evilmartians/lefthook/master/schema.json",
    "sourceSha256": "5118b400b3ca2047eff1ec45391e07e188e1a33aaa4e4b767f843dfaeb9d130d",
    "fileMatch": [
      ".lefthook.json",
      ".lefthook.jsonc",
      ".lefthook.toml",
      ".lefthook.yaml",
      ".lefthook.yml",
      ".lefthook-local.json",
      ".lefthook-local.jsonc",
      ".lefthook-local.toml",
      ".lefthook-local.yaml",
      ".lefthook-local.yml",
      "lefthook.json",
      "lefthook.jsonc",
      "lefthook.toml",
      "lefthook.yaml",
      "lefthook.yml",
      "lefthook-local.json",
      "lefthook-local.jsonc",
      "lefthook-local.toml",
      "lefthook-local.yaml",
      "lefthook-local.yml"
    ],
    "parsers": [
      "json",
      "jsonc",
      "toml",
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "min_version": {
      "type": "string",
      "description": "Specify a minimum version for the lefthook binary"
    },
    "lefthook": {
      "type": "string",
      "description": "Lefthook executable path or command"
    },
    "source_dir": {
      "type": "string",
      "description": "Change a directory for script files. Directory for script files contains folders with git hook names which contain script files.",
      "default": ".lefthook/"
    },
    "source_dir_local": {
      "type": "string",
      "description": "Change a directory for local script files (not stored in VCS)",
      "default": ".lefthook-local/"
    },
    "rc": {
      "type": "string",
      "description": "Provide an rc file - a simple sh script"
    },
    "output": {
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "array"
        }
      ],
      "description": "Manage verbosity by skipping the printing of output of some steps"
    },
    "colors": {
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object"
        }
      ],
      "description": "Enable disable or set your own colors for lefthook output"
    },
    "extends": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "Specify files to extend config with"
    },
    "no_tty": {
      "type": "boolean",
      "description": "Whether hide spinner and other interactive things"
    },
    "assert_lefthook_installed": {
      "type": "boolean"
    },
    "skip_lfs": {
      "type": "boolean",
      "description": "Skip running Git LFS hooks (enabled by default)"
    },
    "no_auto_install": {
      "type": "boolean",
      "description": "Do not automatically install hooks when running lefthook"
    },
    "install_non_git_hooks": {
      "type": "boolean",
      "description": "Install non-Git hooks to .git/hooks"
    },
    "glob_matcher": {
      "type": "string",
      "enum": [
        "gobwas",
        "doublestar"
      ],
      "description": "Choose the glob matching engine: 'gobwas' (default) or 'doublestar' (standard ** behavior)",
      "default": "gobwas"
    },
    "remotes": {
      "items": {
        "$ref": "#/$defs/Remote"
      },
      "type": "array",
      "description": "Provide multiple remote configs to use lefthook configurations shared across projects. Lefthook will automatically download and merge configurations into main config."
    },
    "templates": {
      "description": "Custom templates for replacements in run commands.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "$schema": {
      "type": "string"
    },
    "pre-commit": {
      "$ref": "#/$defs/Hook"
    },
    "applypatch-msg": {
      "$ref": "#/$defs/Hook"
    },
    "pre-applypatch": {
      "$ref": "#/$defs/Hook"
    },
    "post-applypatch": {
      "$ref": "#/$defs/Hook"
    },
    "pre-merge-commit": {
      "$ref": "#/$defs/Hook"
    },
    "prepare-commit-msg": {
      "$ref": "#/$defs/Hook"
    },
    "commit-msg": {
      "$ref": "#/$defs/Hook"
    },
    "post-commit": {
      "$ref": "#/$defs/Hook"
    },
    "pre-rebase": {
      "$ref": "#/$defs/Hook"
    },
    "post-checkout": {
      "$ref": "#/$defs/Hook"
    },
    "post-merge": {
      "$ref": "#/$defs/Hook"
    },
    "pre-push": {
      "$ref": "#/$defs/Hook"
    },
    "pre-receive": {
      "$ref": "#/$defs/Hook"
    },
    "update": {
      "$ref": "#/$defs/Hook"
    },
    "proc-receive": {
      "$ref": "#/$defs/Hook"
    },
    "post-receive": {
      "$ref": "#/$defs/Hook"
    },
    "post-update": {
      "$ref": "#/$defs/Hook"
    },
    "reference-transaction": {
      "$ref": "#/$defs/Hook"
    },
    "push-to-checkout": {
      "$ref": "#/$defs/Hook"
    },
    "pre-auto-gc": {
      "$ref": "#/$defs/Hook"
    },
    "post-rewrite": {
      "$ref": "#/$defs/Hook"
    },
    "sendemail-validate": {
      "$ref": "#/$defs/Hook"
    },
    "fsmonitor-watchman": {
      "$ref": "#/$defs/Hook"
    },
    "p4-changelist": {
      "$ref": "#/$defs/Hook"
    },
    "p4-prepare-changelist": {
      "$ref": "#/$defs/Hook"
    },
    "p4-post-changelist": {
      "$ref": "#/$defs/Hook"
    },
    "p4-pre-submit": {
      "$ref": "#/$defs/Hook"
    },
    "post-index-change": {
      "$ref": "#/$defs/Hook"
    }
  },
  "$comment": "Last updated on 2026.02.28.",
  "additionalProperties": {
    "properties": {
      "parallel": {
        "type": "boolean"
      },
      "piped": {
        "type": "boolean"
      },
      "follow": {
        "type": "boolean"
      },
      "fail_on_changes": {
        "type": "string",
        "enum": [
          "true",
          "1",
          "0",
          "false",
          "never",
          "always",
          "ci",
          "non-ci"
        ]
      },
      "fail_on_changes_diff": {
        "type": "boolean"
      },
      "files": {
        "type": "string"
      },
      "exclude_tags": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "exclude": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "skip": {
        "oneOf": [
          {
            "type": "boolean"
          },
          {
            "type": "array"
          }
        ]
      },
      "only": {
        "oneOf": [
          {
            "type": "boolean"
          },
          {
            "type": "array"
          }
        ]
      },
      "setup": {
        "items": {
          "$ref": "#/$defs/SetupInstruction"
        },
        "type": "array"
      },
      "jobs": {
        "items": {
          "$ref": "#/$defs/Job"
        },
        "type": "array"
      },
      "commands": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/$defs/Command"
        }
      },
      "scripts": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/$defs/Script"
        }
      }
    },
    "type": "object",
    "additionalProperties": false
  },
  "$defs": {
    "Command": {
      "properties": {
        "run": {
          "type": "string"
        },
        "files": {
          "type": "string"
        },
        "root": {
          "type": "string"
        },
        "fail_text": {
          "type": "string"
        },
        "timeout": {
          "type": "string",
          "examples": [
            "15s"
          ]
        },
        "skip": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "only": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "tags": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "file_types": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "glob": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "priority": {
          "type": "integer"
        },
        "interactive": {
          "type": "boolean"
        },
        "use_stdin": {
          "type": "boolean"
        },
        "stage_fixed": {
          "type": "boolean"
        }
      },
      "required": [
        "run"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Group": {
      "properties": {
        "root": {
          "type": "string"
        },
        "parallel": {
          "type": "boolean"
        },
        "piped": {
          "type": "boolean"
        },
        "jobs": {
          "items": {
            "$ref": "#/$defs/Job"
          },
          "type": "array"
        }
      },
      "required": [
        "jobs"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Hook": {
      "properties": {
        "parallel": {
          "type": "boolean"
        },
        "piped": {
          "type": "boolean"
        },
        "follow": {
          "type": "boolean"
        },
        "fail_on_changes": {
          "type": "string",
          "enum": [
            "true",
            "1",
            "0",
            "false",
            "never",
            "always",
            "ci",
            "non-ci"
          ]
        },
        "fail_on_changes_diff": {
          "type": "boolean"
        },
        "files": {
          "type": "string"
        },
        "exclude_tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "exclude": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "skip": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "only": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "setup": {
          "items": {
            "$ref": "#/$defs/SetupInstruction"
          },
          "type": "array"
        },
        "jobs": {
          "items": {
            "$ref": "#/$defs/Job"
          },
          "type": "array"
        },
        "commands": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Command"
          }
        },
        "scripts": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Script"
          }
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "Job": {
      "oneOf": [
        {
          "required": [
            "run"
          ],
          "title": "Run a command"
        },
        {
          "required": [
            "script"
          ],
          "title": "Run a script"
        },
        {
          "required": [
            "group"
          ],
          "title": "Run a group"
        }
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "run": {
          "type": "string"
        },
        "script": {
          "type": "string"
        },
        "runner": {
          "type": "string"
        },
        "args": {
          "type": "string"
        },
        "root": {
          "type": "string"
        },
        "files": {
          "type": "string"
        },
        "fail_text": {
          "type": "string"
        },
        "timeout": {
          "type": "string",
          "examples": [
            "15s"
          ]
        },
        "glob": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "file_types": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "interactive": {
          "type": "boolean"
        },
        "use_stdin": {
          "type": "boolean"
        },
        "stage_fixed": {
          "type": "boolean"
        },
        "skip": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "only": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "group": {
          "$ref": "#/$defs/Group"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "Remote": {
      "properties": {
        "git_url": {
          "type": "string",
          "description": "A URL to Git repository. It will be accessed with privileges of the machine lefthook runs on."
        },
        "ref": {
          "type": "string",
          "description": "An optional *branch* or *tag* name"
        },
        "configs": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "An optional array of config paths from remote's root",
          "default": [
            "lefthook.yml"
          ]
        },
        "refetch": {
          "type": "boolean",
          "description": "Set to true if you want to always refetch the remote"
        },
        "refetch_frequency": {
          "type": "string",
          "description": "Provide a frequency for the remotes refetches",
          "examples": [
            "24h"
          ]
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "Script": {
      "properties": {
        "runner": {
          "type": "string"
        },
        "args": {
          "type": "string"
        },
        "skip": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "only": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "tags": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ],
          "items": {
            "type": "string"
          }
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "priority": {
          "type": "integer"
        },
        "fail_text": {
          "type": "string"
        },
        "timeout": {
          "type": "string",
          "examples": [
            "15s"
          ]
        },
        "interactive": {
          "type": "boolean"
        },
        "use_stdin": {
          "type": "boolean"
        },
        "stage_fixed": {
          "type": "boolean"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "SetupInstruction": {
      "oneOf": [
        {
          "required": [
            "run"
          ],
          "title": "Run a command"
        }
      ],
      "properties": {
        "run": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  }
}
