Summary
Existing pre-commit config files that use file patterns like exclude don't pass yaml schema validation in prek.
This is the definition of global file exclude patterns: use FilePattern.
"exclude": {
"description": "Global file exclude pattern.",
"anyOf": [
{
"$ref": "#/definitions/FilePattern"
},
{
"type": "null"
}
]
},
FilePattern is:
"FilePattern": {
"description": "A file pattern, either a regex or glob pattern(s).",
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"regex": {
"description": "A regular expression pattern.",
"type": "string"
}
},
"required": [
"regex"
]
},
{
"type": "object",
"properties": {
"glob": {
"oneOf": [
{
"description": "A glob pattern.",
"type": "string"
},
{
"description": "A list of glob patterns.",
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"glob"
]
}
]
},
Note that it doesn't include being a plain string at the top level of FilePattern. i.e.:
This means that existing pre-commit config files that use exclusions don't pass validation with the provided JSON schema.
Platform
n/a
Version
d42b733
.pre-commit-config.yaml
---
$schema: https://raw.githubusercontent.com/j178/prek/refs/heads/master/prek.schema.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/j178/prek/refs/heads/master/prek.schema.json
exclude: foo
Log file
N/A you don't have to run prek.
Summary
Existing pre-commit config files that use file patterns like
excludedon't pass yaml schema validation in prek.This is the definition of global file exclude patterns: use
FilePattern.FilePattern is:
Note that it doesn't include being a plain string at the top level of FilePattern. i.e.:
This means that existing pre-commit config files that use exclusions don't pass validation with the provided JSON schema.
Platform
n/a
Version
d42b733
.pre-commit-config.yaml
Log file
N/A you don't have to run prek.