Joey Armstrong | ec895f8 | 2024-04-25 14:26:07 -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 | # ----------------------------------------------------------------------- |
| 34 | # .pre-commit-config-yaml 2024-04-19 v0.4 |
| 35 | # ----------------------------------------------------------------------- |
| 36 | |
| 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' |
| 45 | |
| 46 | repos: |
| 47 | - repo: https://github.com/pre-commit/pre-commit-hooks |
| 48 | # rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0 |
| 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 |
| 58 | # - id: debug-statements |
| 59 | - id: end-of-file-fixer |
| 60 | - id: fix-encoding-pragma |
| 61 | # - id: double-quote-string-fixer |
| 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 | |
| 81 | ## ----------------------------------------------------------------------- |
| 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 | |
| 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 | ## ----------------------------------------------------------------------- |
| 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 | ## ----------------------------------------------------------------------- |
| 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 |
| 131 | |
| 132 | ## ----------------------------------------------------------------------- |
| 133 | ## [SOURCE] Python |
| 134 | ## ----------------------------------------------------------------------- |
| 135 | # - repo: https://github.com/psf/black |
| 136 | # rev: 22.10.0 |
| 137 | # hooks: |
| 138 | # - id: black |
| 139 | |
| 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 |
| 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] |