{
  "$id": "https://json.schemastore.org/lefthook.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "Skip": {
      "description": "Skip all or specific commands and scripts",
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "Only": {
      "description": "Force the command, script, or hook to execute only in certain conditions. This acts like the opposite of skip.",
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "ref": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "string"
        }
      ]
    },
    "Tags": {
      "description": "Specify tags for commands and scripts, useful for excluding",
      "type": "string"
    },
    "Env": {
      "type": "object",
      "description": "Specify environment variables for the command or script.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "FailText": {
      "description": "Text to show when the command or script fails.",
      "type": "string"
    },
    "StageFixed": {
      "description": "Only for the 'pre-commit' hooks, this automatically calls 'git add' after running the command or script.",
      "type": "boolean"
    },
    "Interactive": {
      "description": "Whether to use interactive mode and provide a STDIN for a command or script.",
      "type": "boolean"
    },
    "GitHook": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "skip": {
          "$ref": "#/definitions/Skip"
        },
        "only": {
          "$ref": "#/definitions/Only"
        },
        "files": {
          "description": "A custom git command for files to be referenced in {files} template.",
          "type": "string"
        },
        "parallel": {
          "description": "Whether run commands and scripts concurrently.",
          "type": "boolean",
          "default": false
        },
        "piped": {
          "description": "Whether run commands and scripts sequentially. Will stop execution if one of the commands/scripts fail.",
          "default": false,
          "type": "boolean"
        },
        "follow": {
          "description": "Follow the STDOUT of the running commands and scripts.",
          "type": "boolean",
          "default": false
        },
        "exclude_tags": {
          "type": "string",
          "description": "Tags or command names that you want to exclude."
        },
        "commands": {
          "description": "Commands to be executed for the hook.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/Command"
          }
        },
        "scripts": {
          "description": "Scripts to be executed for the hook.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/Script"
          }
        }
      }
    },
    "Command": {
      "type": "object",
      "additionalProperties": false,
      "required": ["run"],
      "properties": {
        "run": {
          "description": "The command that is executed for the hook",
          "type": "string"
        },
        "skip": {
          "$ref": "#/definitions/Skip"
        },
        "only": {
          "$ref": "#/definitions/Only"
        },
        "tags": {
          "$ref": "#/definitions/Tags"
        },
        "glob": {
          "description": "Set a glob to filter files for your command.",
          "type": "string"
        },
        "files": {
          "description": "Custom Git commit for files to be referenced in {files} template for the 'run' setting.",
          "type": "string"
        },
        "env": {
          "$ref": "#/definitions/Env"
        },
        "root": {
          "type": "string",
          "description": "Change the CWD for the command you execute."
        },
        "exclude": {
          "description": "Provide a regular expression to exclude some files from being passed to the 'run' command.",
          "type": "string"
        },
        "fail_text": {
          "$ref": "#/definitions/FailText"
        },
        "stage_fixed": {
          "$ref": "#/definitions/StageFixed"
        },
        "interactive": {
          "$ref": "#/definitions/Interactive"
        }
      }
    },
    "Script": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "runner": {
          "type": "string"
        },
        "skip": {
          "$ref": "#/definitions/Skip"
        },
        "only": {
          "$ref": "#/definitions/Only"
        },
        "tags": {
          "$ref": "#/definitions/Tags"
        },
        "env": {
          "$ref": "#/definitions/Env"
        },
        "fail_text": {
          "$ref": "#/definitions/FailText"
        },
        "stage_fixed": {
          "$ref": "#/definitions/StageFixed"
        },
        "interactive": {
          "$ref": "#/definitions/Interactive"
        }
      }
    }
  },
  "properties": {
    "colors": {
      "description": "Whether enable or disable colorful output of Lefthook.",
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      ]
    },
    "no_tty": {
      "description": "Whether hide spinner and other interactive things.",
      "type": "boolean"
    },
    "extends": {
      "description": "Specify files to extend config with.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "min_version": {
      "description": "Specify a minimum version for the lefthook binary.",
      "type": "string"
    },
    "skip_output": {
      "description": "Manage verbosity by skipping the printing of output of some steps.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "meta",
          "success",
          "failure",
          "summary",
          "execution",
          "execution_out",
          "execution_info",
          "skips"
        ]
      }
    },
    "source_dir": {
      "description": "Change a directory for script files. Directory for script files contains folders with git hook names which contain script files.",
      "type": "string",
      "default": ".lefthook/"
    },
    "source_dir_local": {
      "description": "Change a directory for local script files (not stored in VCS).",
      "type": "string",
      "default": ".lefthook-local/"
    },
    "rc": {
      "description": "Provide an rc file, which is actually a simple sh script",
      "type": "string"
    },
    "remote": {
      "description": "Remote configs enable sharing of lefthook configuration across many projects.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "git_url": {
          "description": "A URL to Git repository. It will be accessed with priveleges of the machine lefthook runs on.",
          "type": "string"
        },
        "ref": {
          "description": "An optional branch or tag name.",
          "type": "string"
        },
        "config": {
          "description": "An optional config path from remote's root.",
          "type": "string"
        }
      }
    },
    "pre-applypatch": {
      "$ref": "#/definitions/GitHook"
    },
    "applypatch-msg": {
      "$ref": "#/definitions/GitHook"
    },
    "post-applypatch": {
      "$ref": "#/definitions/GitHook"
    },
    "commit-msg": {
      "$ref": "#/definitions/GitHook"
    },
    "fsmonitor-watchman": {
      "$ref": "#/definitions/GitHook"
    },
    "p4-changelist": {
      "$ref": "#/definitions/GitHook"
    },
    "p4-post-changelist": {
      "$ref": "#/definitions/GitHook"
    },
    "p4-pre-submit": {
      "$ref": "#/definitions/GitHook"
    },
    "p4-prepare-changelist": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-commit": {
      "$ref": "#/definitions/GitHook"
    },
    "post-commit": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-receive": {
      "$ref": "#/definitions/GitHook"
    },
    "proc-receive": {
      "$ref": "#/definitions/GitHook"
    },
    "post-receive": {
      "$ref": "#/definitions/GitHook"
    },
    "post-merge": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-rebase": {
      "$ref": "#/definitions/GitHook"
    },
    "rebase": {
      "$ref": "#/definitions/GitHook"
    },
    "update": {
      "$ref": "#/definitions/GitHook"
    },
    "post-update": {
      "$ref": "#/definitions/GitHook"
    },
    "post-rewrite": {
      "$ref": "#/definitions/GitHook"
    },
    "post-checkout": {
      "$ref": "#/definitions/GitHook"
    },
    "post-index-change": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-auto-gc": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-merge-commit": {
      "$ref": "#/definitions/GitHook"
    },
    "pre-push": {
      "$ref": "#/definitions/GitHook"
    },
    "prepare-commit-msg": {
      "$ref": "#/definitions/GitHook"
    },
    "push-to-checkout": {
      "$ref": "#/definitions/GitHook"
    },
    "reference-transaction": {
      "$ref": "#/definitions/GitHook"
    },
    "sendemail-validate": {
      "$ref": "#/definitions/GitHook"
    }
  },
  "type": "object"
}