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