Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 1 | --- |
| 2 | |
| 3 | # ----------------------------------------------------------------------- |
| 4 | # [NOTE] - Propogate .pre-commit-config.yaml edits to all repositories! |
| 5 | # ----------------------------------------------------------------------- |
| 6 | # [TODO] |
| 7 | # - pre-commit yaml config exists individually within repositories. |
| 8 | # - Generally lint config and benavior is consistent for all repos. |
| 9 | # - Exclusions and bulk cleanup necessitate per-repo custom configs. |
| 10 | # - Dynamically generate this config file from common and custom |
| 11 | # ----------------------------------------------------------------------- |
| 12 | |
| 13 | # ----------------------------------------------------------------------- |
| 14 | # Copyright 2024 Open Networking Foundation Contributors |
| 15 | # |
| 16 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 17 | # you may not use this file except in compliance with the License. |
| 18 | # You may obtain a copy of the License at |
| 19 | # |
| 20 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 21 | # |
| 22 | # Unless required by applicable law or agreed to in writing, software |
| 23 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 24 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 25 | # See the License for the specific language governing permissions and |
| 26 | # limitations under the License. |
| 27 | # ----------------------------------------------------------------------- |
| 28 | # SPDX-FileCopyrightText: 2024 Open Networking Foundation Contributors |
| 29 | # SPDX-License-Identifier: Apache-2.0 |
| 30 | # ----------------------------------------------------------------------- |
| 31 | # See https://pre-commit.com for more information |
| 32 | # See https://pre-commit.com/hooks.html for more hooks |
| 33 | # ----------------------------------------------------------------------- |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 34 | # .pre-commit-config-yaml 2024-04-19 v0.4 |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 35 | # ----------------------------------------------------------------------- |
| 36 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 37 | #ci: |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 38 | # autofix_commit_msg: "Chore: pre-commit autoupdate" |
| 39 | ## skip: [sync] |
| 40 | # skip: |
| 41 | # # pre-commit.ci does not have actionlint installed |
| 42 | # - actionlint |
| 43 | # |
| 44 | # exclude: '^docs/conf.py' |
| 45 | |
| 46 | repos: |
| 47 | - repo: https://github.com/pre-commit/pre-commit-hooks |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 48 | # rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0 |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 49 | rev: v4.5.0 |
| 50 | hooks: |
| 51 | - id: trailing-whitespace |
| 52 | - id: check-added-large-files |
| 53 | - id: check-ast |
| 54 | - id: check-json |
| 55 | - id: check-merge-conflict |
| 56 | - id: check-xml |
| 57 | - id: check-yaml |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 58 | # - id: debug-statements |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 59 | - id: end-of-file-fixer |
| 60 | - id: fix-encoding-pragma |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 61 | # - id: double-quote-string-fixer |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 62 | - id: requirements-txt-fixer |
| 63 | - id: mixed-line-ending |
| 64 | args: ['--fix=lf'] |
| 65 | |
| 66 | - repo: https://github.com/jorisroovers/gitlint |
| 67 | rev: acc9d9de6369b76d22cb4167029d2035e8730b98 # frozen: v0.19.1 |
| 68 | hooks: |
| 69 | - id: gitlint |
| 70 | |
| 71 | - repo: https://github.com/koalaman/shellcheck-precommit |
| 72 | rev: v0.10.0 |
| 73 | hooks: |
| 74 | - id: shellcheck |
| 75 | |
| 76 | - repo: https://github.com/adrienverge/yamllint.git |
| 77 | rev: v1.35.1 |
| 78 | hooks: |
| 79 | - id: yamllint |
| 80 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 81 | ## ----------------------------------------------------------------------- |
| 82 | ## [SOURCE] Documentation |
| 83 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 84 | - repo: https://github.com/rstcheck/rstcheck |
| 85 | rev: v6.2.1 |
| 86 | hooks: |
| 87 | - id: rstcheck |
| 88 | |
| 89 | - repo: https://github.com/markdownlint/markdownlint |
| 90 | rev: v0.13.0 |
| 91 | hooks: |
| 92 | - id: markdownlint |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 93 | # - id: markdownlint_docker |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 94 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 95 | ## ----------------------------------------------------------------------- |
| 96 | ## [SOURCE] Docker |
| 97 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 98 | - repo: https://github.com/hadolint/hadolint |
| 99 | rev: v2.12.0 |
| 100 | hooks: |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 101 | - id: hadolint |
| 102 | # - id: hadolint-docker |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 103 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 104 | ## ----------------------------------------------------------------------- |
| 105 | ## [SOURCE] Golang |
| 106 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 107 | - repo: https://github.com/golangci/golangci-lint |
| 108 | rev: v1.41.1 |
| 109 | hooks: |
| 110 | - id: golangci-lint |
| 111 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 112 | ## ----------------------------------------------------------------------- |
| 113 | ## [SOURCE] REUSE License Checking |
| 114 | ## ----------------------------------------------------------------------- |
| 115 | # - repo: https://github.com/fsfe/reuse-tool |
| 116 | # rev: v3.0.2 |
| 117 | # hooks: |
| 118 | # - id: reuse |
| 119 | # - id: add-license-headers |
| 120 | # |
| 121 | # - repo: https://github.com/ansys/pre-commit-hooks |
| 122 | # rev: v0.2.9 |
| 123 | # hooks: |
| 124 | # - id: add-license-headers |
| 125 | # args: |
| 126 | # - --custom_copyright=custom copyright phrase |
| 127 | # - --custom_template=template_name |
| 128 | # - --custom_license=license_name |
| 129 | # - --ignore_license_check |
| 130 | # - --start_year=2023 |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 131 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 132 | ## ----------------------------------------------------------------------- |
| 133 | ## [SOURCE] Python |
| 134 | ## ----------------------------------------------------------------------- |
| 135 | # - repo: https://github.com/psf/black |
| 136 | # rev: 22.10.0 |
| 137 | # hooks: |
| 138 | # - id: black |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 139 | |
| 140 | # - repo: https://github.com/PyCQA/doc8 |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 141 | # rev: v1.1.1 |
| 142 | # hooks: |
| 143 | # - id: doc8 |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 144 | |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 145 | ## ----------------------------------------------------------------------- |
| 146 | ## [SOURCE] Testing |
| 147 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 148 | - repo: https://github.com/MarketSquare/robotframework-tidy |
| 149 | rev: 4.11.0 |
| 150 | hooks: |
| 151 | - id: robotidy |
| 152 | |
| 153 | # ------------------------------------------------------------------- |
| 154 | # https://docs.python.org/3/library/re.html#regular-expression-syntax |
| 155 | # ------------------------------------------------------------------- |
| 156 | exclude: | |
| 157 | (?x)^( |
Eric Ball | f1055a9 | 2024-09-05 11:01:28 -0700 | [diff] [blame] | 158 | ^makefiles/.* | |
| 159 | ^lf/.* | |
| 160 | ^.venv/.* | |
Joey Armstrong | 6a6c629 | 2024-04-30 16:07:38 -0400 | [diff] [blame] | 161 | ^ignore-end-of-exclude-marker |
| 162 | )$ |
| 163 | |
| 164 | # [SEE ALSO] |
| 165 | # ----------------------------------------------------------------------- |
| 166 | # https://github.com/memfault/interrupt/blob/master/example/pre-commit/.pre-commit-config.yaml |
| 167 | # https://pre-commit.com/hooks.html |
| 168 | # https://github.com/floatingpurr/sync_with_poetry/blob/main/.pre-commit-config.yaml |
| 169 | # https://github.com/the-common/pre-commit-config-template/blob/master/.pre-commit-config.yaml |
| 170 | # https://github.com/memfault/interrupt/blob/master/example/pre-commit/.pre-commit-config.yaml |
| 171 | # ----------------------------------------------------------------------- |
| 172 | # https://www.hatica.io/blog/pre-commit-git-hooks/ |
| 173 | # ----------------------------------------------------------------------- |
| 174 | |
| 175 | # [EOF] |