diff --git a/src/schemas/json/prek.json b/src/schemas/json/prek.json index 02ac4e54430..b1e22fd9d50 100644 --- a/src/schemas/json/prek.json +++ b/src/schemas/json/prek.json @@ -9,6 +9,17 @@ "$ref": "#/definitions/UpdateOptions", "description": "Default settings for `prek update` in this project." }, + "priorities": { + "description": "Configuration-local aliases for numeric hook priorities.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^\\S+$": { + "type": "integer", + "minimum": 0 + } + } + }, "repos": { "type": "array", "items": { @@ -261,9 +272,8 @@ "description": "Override the language. Not documented in the official docs but works." }, "priority": { - "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`).", - "type": "integer", - "minimum": 0 + "$ref": "#/definitions/Priority", + "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`)." }, "groups": { "description": "User-defined hook groups used by `prek run --group` and `--no-group`.\nGroup names cannot be empty or contain whitespace.", @@ -411,6 +421,21 @@ "system" ] }, + "Priority": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/PriorityAlias" + } + ] + }, + "PriorityAlias": { + "type": "string", + "pattern": "^\\S+$" + }, "FilePattern": { "description": "A file pattern, either a regex or glob pattern(s).", "oneOf": [ @@ -514,9 +539,8 @@ "description": "The language of the hook. Tells prek how to install and run the hook." }, "priority": { - "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.", - "type": "integer", - "minimum": 0 + "$ref": "#/definitions/Priority", + "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel." }, "groups": { "description": "User-defined hook groups used by `prek run --group` and `--no-group`.\nGroup names cannot be empty or contain whitespace.", @@ -675,9 +699,8 @@ "enum": ["system"] }, "priority": { - "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`).", - "type": "integer", - "minimum": 0 + "$ref": "#/definitions/Priority", + "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`)." }, "groups": { "description": "User-defined hook groups used by `prek run --group` and `--no-group`.\nGroup names cannot be empty or contain whitespace.", @@ -840,9 +863,8 @@ "enum": ["system"] }, "priority": { - "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`).", - "type": "integer", - "minimum": 0 + "$ref": "#/definitions/Priority", + "description": "Priority used by the scheduler to determine ordering and concurrency.\nHooks with the same priority can run in parallel.\n\nThis is only allowed in project config files (e.g. `.pre-commit-config.yaml`).\nIt is not allowed in manifests (e.g. `.pre-commit-hooks.yaml`)." }, "groups": { "description": "User-defined hook groups used by `prek run --group` and `--no-group`.\nGroup names cannot be empty or contain whitespace.", @@ -977,6 +999,7 @@ "check-vcs-permalinks", "check-xml", "check-yaml", + "deny-pattern", "destroyed-symlinks", "detect-private-key", "end-of-file-fixer", @@ -986,6 +1009,8 @@ "mixed-line-ending", "no-commit-to-branch", "pretty-format-json", + "require-pattern", + "requirements-txt-fixer", "trailing-whitespace" ] },