xref: /trunk/.pre-commit-config.yaml (revision d941b70c83dc1cf56dc95264273f8a288e742c24)
1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements.  See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership.  The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License.  You may obtain a copy of the License at
8#
9#   http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied.  See the License for the
15# specific language governing permissions and limitations
16# under the License.
17---
18default_stages: [pre-commit, pre-push]
19default_language_version:
20  # force all unspecified Python hooks to run python3
21  python: python3
22minimum_pre_commit_version: "2.17.0"
23repos:
24  - repo: meta
25    hooks:
26      - id: identity
27      - id: check-hooks-apply
28  - repo: https://github.com/pre-commit/pre-commit-hooks
29    rev: v5.0.0
30    hooks:
31      - id: check-case-conflict
32      - id: check-illegal-windows-names
33      - id: check-merge-conflict
34      - id: check-vcs-permalinks
35      - id: end-of-file-fixer
36        files: (m|M)akefile$|\.(bat|c|cxx|dxp|h|hrc|hxx|idl|in|ini|java|md|mk|pl|pm|py|rc|sh|xcs|xdl|xhp|xmi|xsd|xslt?|ya?ml)$|^ext_libraries/.*$|^test/.*$
37      - id: fix-byte-order-marker
38      - id: mixed-line-ending
39        files: ^main/.*\.(c|h)xx$|^main/.*\.java$|\.(c|dxp|h|hrc|idl|in|ini|md|mk|pl|pm|py|rc|sh|xcs|xdl|xhp|xmi|xsd|xslt?|ya?ml)$|^main/accessibility/.*$|^main/afms/.*$|^main/animations/.*$|^main/apache-commons/.*$
40      - id: trailing-whitespace
41        files: \.(bat|ini|pl|rc|sh|xcs|xdl|xmi|xsd|ya?ml)$
42  - repo: https://github.com/codespell-project/codespell
43    rev: v2.4.1
44    hooks:
45      - id: codespell
46        name: run codespell
47        description: check spelling with codespell
48        args: [--ignore-words=.github/linters/codespell.txt]
49        exclude: ^extras/
50