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 | # ----------------------------------------------------------------------- |
| 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 | # ----------------------------------------------------------------------- |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 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 | # |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 20 | # http://www.apache.org/licenses/LICENSE-2.0 |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 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 | # ----------------------------------------------------------------------- |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 34 | # .pre-commit-config-yaml 2024-04-19 v0.4 |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 35 | # ----------------------------------------------------------------------- |
| 36 | |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 37 | #ci: |
| 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' |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 45 | |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 46 | repos: |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 47 | - repo: https://github.com/pre-commit/pre-commit-hooks |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 48 | # rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0 |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 49 | rev: v4.5.0 |
| 50 | hooks: |
| 51 | - id: trailing-whitespace |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 52 | - id: check-added-large-files |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 53 | - id: check-ast |
| 54 | - id: check-json |
| 55 | - id: check-merge-conflict |
| 56 | - id: check-xml |
| 57 | - id: check-yaml |
| 58 | # - id: debug-statements |
| 59 | - id: end-of-file-fixer |
| 60 | - id: fix-encoding-pragma |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 61 | # - id: double-quote-string-fixer |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -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 |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 70 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 71 | - repo: https://github.com/koalaman/shellcheck-precommit |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 72 | rev: v0.10.0 |
| 73 | hooks: |
| 74 | - id: shellcheck |
| 75 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 76 | - repo: https://github.com/adrienverge/yamllint.git |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 77 | rev: v1.35.1 |
| 78 | hooks: |
| 79 | - id: yamllint |
| 80 | |
| 81 | ## ----------------------------------------------------------------------- |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 82 | ## [SOURCE] Documentation |
| 83 | ## ----------------------------------------------------------------------- |
| 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 |
| 93 | # - id: markdownlint_docker |
| 94 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 95 | ## ----------------------------------------------------------------------- |
| 96 | ## [SOURCE] Docker |
| 97 | ## ----------------------------------------------------------------------- |
| 98 | - repo: https://github.com/hadolint/hadolint |
| 99 | rev: v2.12.0 |
| 100 | hooks: |
| 101 | - id: hadolint |
| 102 | # - id: hadolint-docker |
| 103 | |
| 104 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 105 | ## [SOURCE] Golang |
| 106 | ## ----------------------------------------------------------------------- |
| 107 | - repo: https://github.com/golangci/golangci-lint |
| 108 | rev: v1.41.1 |
| 109 | hooks: |
| 110 | - id: golangci-lint |
| 111 | |
| 112 | ## ----------------------------------------------------------------------- |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 113 | ## [SOURCE] REUSE License Checking |
| 114 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 6f046d0 | 2024-04-22 13:29:56 -0400 | [diff] [blame^] | 115 | # - repo: https://github.com/fsfe/reuse-tool |
| 116 | # rev: v3.0.2 |
| 117 | # hooks: |
| 118 | # - id: reuse |
| 119 | # - id: add-license-headers |
| 120 | # |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 121 | # - repo: https://github.com/ansys/pre-commit-hooks |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 122 | # rev: v0.2.9 |
| 123 | # hooks: |
| 124 | # - id: add-license-headers |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 125 | # args: |
| 126 | # - --custom_copyright=custom copyright phrase |
| 127 | # - --custom_template=template_name |
| 128 | # - --custom_license=license_name |
| 129 | # - --ignore_license_check |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 130 | # - --start_year=2023 |
| 131 | |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 132 | ## ----------------------------------------------------------------------- |
| 133 | ## [SOURCE] Python |
| 134 | ## ----------------------------------------------------------------------- |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 135 | # - repo: https://github.com/psf/black |
| 136 | # rev: 22.10.0 |
| 137 | # hooks: |
| 138 | # - id: black |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 139 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 140 | # - repo: https://github.com/PyCQA/doc8 |
| 141 | # rev: v1.1.1 |
| 142 | # hooks: |
| 143 | # - id: doc8 |
| 144 | |
| 145 | ## ----------------------------------------------------------------------- |
| 146 | ## [SOURCE] Testing |
| 147 | ## ----------------------------------------------------------------------- |
| 148 | - repo: https://github.com/MarketSquare/robotframework-tidy |
| 149 | rev: 4.11.0 |
| 150 | hooks: |
| 151 | - id: robotidy |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 152 | |
| 153 | # ------------------------------------------------------------------- |
| 154 | # https://docs.python.org/3/library/re.html#regular-expression-syntax |
| 155 | # ------------------------------------------------------------------- |
| 156 | exclude: | |
| 157 | (?x)^( |
| 158 | ^jjb/.* | |
| 159 | ^makefiles/.* | |
| 160 | ^lf/.* | |
| 161 | ^.venv/.* | |
| 162 | ^jenkins-scripts/.* | |
| 163 | ^lf-ansible/.* | |
| 164 | ^packer/.* | |
| 165 | ^test/.* | |
| 166 | ^jjb/pipeline/voltha/voltha-physical-soak-dt-tests.groovy |
| 167 | )$ |
| 168 | |
| 169 | # [SEE ALSO] |
| 170 | # ----------------------------------------------------------------------- |
| 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 | # ----------------------------------------------------------------------- |
| 179 | |
| 180 | # [EOF] |