xref: /trunk/.pre-commit-config.yaml (revision 42e730866ca24d6cd8569b45d0b72270b18de7cb)
1fc87ac04SJohn Bampton# Licensed to the Apache Software Foundation (ASF) under one
2fc87ac04SJohn Bampton# or more contributor license agreements.  See the NOTICE file
3fc87ac04SJohn Bampton# distributed with this work for additional information
4fc87ac04SJohn Bampton# regarding copyright ownership.  The ASF licenses this file
5fc87ac04SJohn Bampton# to you under the Apache License, Version 2.0 (the
6fc87ac04SJohn Bampton# "License"); you may not use this file except in compliance
7fc87ac04SJohn Bampton# with the License.  You may obtain a copy of the License at
8fc87ac04SJohn Bampton#
9fc87ac04SJohn Bampton#   http://www.apache.org/licenses/LICENSE-2.0
10fc87ac04SJohn Bampton#
11fc87ac04SJohn Bampton# Unless required by applicable law or agreed to in writing,
12fc87ac04SJohn Bampton# software distributed under the License is distributed on an
13fc87ac04SJohn Bampton# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14fc87ac04SJohn Bampton# KIND, either express or implied.  See the License for the
15fc87ac04SJohn Bampton# specific language governing permissions and limitations
16fc87ac04SJohn Bampton# under the License.
17fc87ac04SJohn Bampton---
18fc87ac04SJohn Bamptondefault_stages: [pre-commit, pre-push]
19fc87ac04SJohn Bamptondefault_language_version:
20fc87ac04SJohn Bampton  # force all unspecified Python hooks to run python3
21fc87ac04SJohn Bampton  python: python3
22670f140bSJohn Bamptonminimum_pre_commit_version: "3.2.0"
23fc87ac04SJohn Bamptonrepos:
24fc87ac04SJohn Bampton  - repo: meta
25fc87ac04SJohn Bampton    hooks:
26fc87ac04SJohn Bampton      - id: identity
27fc87ac04SJohn Bampton      - id: check-hooks-apply
28670f140bSJohn Bampton  - repo: https://github.com/gitleaks/gitleaks
29*42e73086SJohn Bampton    rev: v8.30.0
30670f140bSJohn Bampton    hooks:
31670f140bSJohn Bampton      - id: gitleaks
32670f140bSJohn Bampton        name: run gitleaks
33670f140bSJohn Bampton        description: check for secrets with gitleaks
342ab0ece2SJohn Bampton  - repo: https://github.com/Lucas-C/pre-commit-hooks
352ab0ece2SJohn Bampton    rev: v1.5.5
362ab0ece2SJohn Bampton    hooks:
372ab0ece2SJohn Bampton      - id: insert-license
382ab0ece2SJohn Bampton        name: add license for all Markdown files
392ab0ece2SJohn Bampton        files: \.md$
402ab0ece2SJohn Bampton        args:
412ab0ece2SJohn Bampton          - --comment-style
422ab0ece2SJohn Bampton          - '<!--||-->'
432ab0ece2SJohn Bampton          - --license-filepath
442ab0ece2SJohn Bampton          - .github/workflows/license-templates/LICENSE.txt
452ab0ece2SJohn Bampton          - --fuzzy-match-generates-todo
4636d8fc78SJohn Bampton  - repo: https://github.com/pre-commit/pre-commit-hooks
474200e9bbSJohn Bampton    rev: v6.0.0
4836d8fc78SJohn Bampton    hooks:
4936d8fc78SJohn Bampton      - id: check-case-conflict
50*42e73086SJohn Bampton        description: check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT
5136d8fc78SJohn Bampton      - id: check-illegal-windows-names
52*42e73086SJohn Bampton        description: check for files that cannot be created on Windows
5336d8fc78SJohn Bampton      - id: check-merge-conflict
54*42e73086SJohn Bampton        description: check for files that contain merge conflict strings
5536d8fc78SJohn Bampton      - id: check-vcs-permalinks
56*42e73086SJohn Bampton        description: ensures that links to vcs websites are permalinks
5755f29005SJohn Bampton      - id: end-of-file-fixer
58*42e73086SJohn Bampton        description: makes sure files end in a newline and only a newline
595702f3daSJohn Bampton        files: (m|M)akefile$|\.(asp|bas|bat|c|cl|cmd|common|component|cpp|cxx|dxp|el|h|hrc|hxx|idl|in|ini|java|js|lst|m|m4|map|md|mk|mm|mod|pas|php|pl|pm|pmk|py|rc|rdf|rng|sdi|sh|src|ulf|vbs|xba|xcs|xcu|xdl|xhp|xlb|xmi|xml|xsd|xslt?|ya?ml)$|^ext_libraries/.*$|^test/.*$
6068a29d56SJohn Bampton      - id: fix-byte-order-marker
61*42e73086SJohn Bampton        description: removes UTF-8 byte order marker
6236d8fc78SJohn Bampton      - id: mixed-line-ending
63*42e73086SJohn Bampton        description: replaces or checks mixed line ending
645702f3daSJohn Bampton        files: \.(asp|bas|c|cl|cmd|common|component|cpp|cxx|dxp|el|h|hrc|hxx|idl|in|ini|java|js|lst|m|m4|map|md|mk|mm|mod|pas|php|pl|pm|pmk|py|rc|rdf|rng|sdi|sh|src|ulf|vbs|xba|xcs|xcu|xdl|xhp|xlb|xmi|xsd|xslt?|ya?ml)$|^main/accessibility/.*$|^main/afms/.*$|^main/animations/.*$|^main/apache-commons/.*$|^test/testgui/.*$
65569f9dbcSJohn Bampton      - id: trailing-whitespace
66*42e73086SJohn Bampton        description: trims trailing whitespace
675702f3daSJohn Bampton        files: (m|M)akefile$|\.(asp|bas|bat|c|cl|cmd|common|component|cpp|cxx|dxp|el|h|hrc|hxx|idl|in|ini|java|js|lst|m|m4|map|md|mk|mm|mod|pas|php|pl|pm|pmk|py|rc|rdf|rng|sdi|sh|src|ulf|vbs|xba|xcs|xcu|xdl|xhp|xlb|xmi|xml|xsd|ya?ml)$
6851bbef7dSJohn Bampton        args: [--markdown-linebreak-ext=md]
69fc87ac04SJohn Bampton  - repo: https://github.com/codespell-project/codespell
70ce9c4aebSJohn Bampton    rev: v2.4.1
71fc87ac04SJohn Bampton    hooks:
72fc87ac04SJohn Bampton      - id: codespell
73fc87ac04SJohn Bampton        name: run codespell
74e7720743SJohn Bampton        description: check spelling with codespell
75e7720743SJohn Bampton        args: [--ignore-words=.github/linters/codespell.txt]
76fc87ac04SJohn Bampton        exclude: ^extras/
77a7f3bf48SJohn Bampton  - repo: https://github.com/igorshubovych/markdownlint-cli
78*42e73086SJohn Bampton    rev: v0.47.0
79a7f3bf48SJohn Bampton    hooks:
80a7f3bf48SJohn Bampton      - id: markdownlint
81a7f3bf48SJohn Bampton        name: run markdownlint
82a7f3bf48SJohn Bampton        description: check Markdown files with markdownlint
83a7f3bf48SJohn Bampton        args: [--config=.github/linters/.markdown-lint.yml]
84a7f3bf48SJohn Bampton        types: [markdown]
85a7f3bf48SJohn Bampton        files: \.md$
86