Files
alfresco-transform-core/.pre-commit-config.yaml

71 lines
2.7 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
# Spring Boot configs use Maven resource-filtering tokens (e.g. @project.version@);
# '@' is a reserved YAML indicator, so strict PyYAML parsing cannot read them.
exclude: '^engines/(aio/src/main/resources/application-default|base/src/main/resources/application)\.yaml$'
- id: check-json
- id: check-xml
- id: check-merge-conflict
# The mutating whitespace hooks are scoped to exclude test-resource fixtures
# and binary assets: those files must stay byte-exact (metadata-extraction
# tests compare their exact content) and pre-commit can misdetect some binaries
# (e.g. *.key) as text. Line endings are additionally governed by .gitattributes.
- id: fix-byte-order-marker
exclude: &fixtures-and-binaries >-
(?x)^(
.*/src/test/resources/.*
|.*/licenses/3rd-party/.*
|engines/libreoffice/src/main/resources/templateProfileDir/.*
|.*\.(key|z|xbm|xpm|vdx|vsd|bin|gz|jar)
)$
- id: mixed-line-ending
args: ['--fix=lf']
exclude: *fixtures-and-binaries
- id: end-of-file-fixer
exclude: *fixtures-and-binaries
- id: trailing-whitespace
exclude: *fixtures-and-binaries
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.37.1
hooks:
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
# markdownlint is configured via .markdownlint.yaml at the repo root, which relaxes
# rules that conflict with the existing docs style (line length, table pipe style,
# …). The --fix flag auto-corrects the mechanical issues (blank lines, bare URLs).
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
hooks:
- id: markdownlint
args: ['--fix']
# Test-resource markdown files are fixtures (transform inputs) and must stay
# byte-exact, so they are excluded from linting/fixing.
exclude: '.*/src/test/resources/.*'
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/hyland/github-actions-ensure-sha-pinned-actions
rev: v1.2.0
hooks:
- id: gha-sha-convert
args: [--allowlist, 'Alfresco/alfresco-build-tools/*']
- repo: local
hooks:
- id: check-format-and-headers
name: Check format and headers and fix if necessary
entry: ./scripts/hooks/check-format-and-headers.sh
language: script
files: ".*.java"
pass_filenames: false