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