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: "3.2.0" 23repos: 24 - repo: meta 25 hooks: 26 - id: identity 27 - id: check-hooks-apply 28 - repo: https://github.com/gitleaks/gitleaks 29 rev: v8.30.0 30 hooks: 31 - id: gitleaks 32 name: run gitleaks 33 description: check for secrets with gitleaks 34 - repo: https://github.com/Lucas-C/pre-commit-hooks 35 rev: v1.5.5 36 hooks: 37 - id: insert-license 38 name: add license for all Markdown files 39 files: \.md$ 40 args: 41 - --comment-style 42 - '<!--||-->' 43 - --license-filepath 44 - .github/workflows/license-templates/LICENSE.txt 45 - --fuzzy-match-generates-todo 46 - repo: https://github.com/pre-commit/pre-commit-hooks 47 rev: v6.0.0 48 hooks: 49 - id: check-case-conflict 50 description: check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT 51 - id: check-illegal-windows-names 52 description: check for files that cannot be created on Windows 53 - id: check-merge-conflict 54 description: check for files that contain merge conflict strings 55 - id: check-vcs-permalinks 56 description: ensures that links to vcs websites are permalinks 57 - id: end-of-file-fixer 58 description: makes sure files end in a newline and only a newline 59 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/.*$ 60 - id: fix-byte-order-marker 61 description: removes UTF-8 byte order marker 62 - id: mixed-line-ending 63 description: replaces or checks mixed line ending 64 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/.*$ 65 - id: trailing-whitespace 66 description: trims trailing whitespace 67 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)$ 68 args: [--markdown-linebreak-ext=md] 69 - repo: https://github.com/codespell-project/codespell 70 rev: v2.4.1 71 hooks: 72 - id: codespell 73 name: run codespell 74 description: check spelling with codespell 75 args: [--ignore-words=.github/linters/codespell.txt] 76 exclude: ^extras/ 77 - repo: https://github.com/igorshubovych/markdownlint-cli 78 rev: v0.47.0 79 hooks: 80 - id: markdownlint 81 name: run markdownlint 82 description: check Markdown files with markdownlint 83 args: [--config=.github/linters/.markdown-lint.yml] 84 types: [markdown] 85 files: \.md$ 86