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 | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 34 | # .pre-commit-config-yaml 2024-04-10 v0.3 |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 35 | # ----------------------------------------------------------------------- |
| 36 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 37 | # ci: |
| 38 | # skip: [sync] |
| 39 | |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 40 | repos: |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 41 | # Sync from repo |
| 42 | - repo: https://github.com/pre-commit/pre-commit-hooks |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 43 | rev: v4.5.0 |
| 44 | hooks: |
| 45 | - id: trailing-whitespace |
| 46 | - id: end-of-file-fixer |
| 47 | - id: check-yaml |
| 48 | - id: check-added-large-files |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 49 | # - id: fix-encoding-pragma |
| 50 | # - id: double-quote-string-fixer |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 51 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 52 | - repo: https://github.com/koalaman/shellcheck-precommit |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 53 | rev: v0.10.0 |
| 54 | hooks: |
| 55 | - id: shellcheck |
| 56 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 57 | - repo: https://github.com/adrienverge/yamllint.git |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 58 | rev: v1.35.1 |
| 59 | hooks: |
| 60 | - id: yamllint |
| 61 | |
| 62 | ## ----------------------------------------------------------------------- |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 63 | ## [SOURCE] Documentation |
| 64 | ## ----------------------------------------------------------------------- |
| 65 | - repo: https://github.com/rstcheck/rstcheck |
| 66 | rev: v6.2.1 |
| 67 | hooks: |
| 68 | - id: rstcheck |
| 69 | |
| 70 | - repo: https://github.com/markdownlint/markdownlint |
| 71 | rev: v0.13.0 |
| 72 | hooks: |
| 73 | - id: markdownlint |
| 74 | # - id: markdownlint_docker |
| 75 | |
| 76 | |
| 77 | ## ----------------------------------------------------------------------- |
| 78 | ## [SOURCE] Docker |
| 79 | ## ----------------------------------------------------------------------- |
| 80 | - repo: https://github.com/hadolint/hadolint |
| 81 | rev: v2.12.0 |
| 82 | hooks: |
| 83 | - id: hadolint |
| 84 | # - id: hadolint-docker |
| 85 | |
| 86 | ## ----------------------------------------------------------------------- |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 87 | ## [SOURCE] REUSE License Checking |
| 88 | ## ----------------------------------------------------------------------- |
| 89 | # - repo: https://github.com/ansys/pre-commit-hooks |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 90 | # rev: v0.2.9 |
| 91 | # hooks: |
| 92 | # - id: add-license-headers |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 93 | # args: |
| 94 | # - --custom_copyright=custom copyright phrase |
| 95 | # - --custom_template=template_name |
| 96 | # - --custom_license=license_name |
| 97 | # - --ignore_license_check |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 98 | # - --start_year=2023 |
| 99 | |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 100 | ## ----------------------------------------------------------------------- |
| 101 | ## [SOURCE] Python |
| 102 | ## ----------------------------------------------------------------------- |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 103 | # - repo: https://github.com/psf/black |
| 104 | # rev: 22.10.0 |
| 105 | # hooks: |
| 106 | # - id: black |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 107 | |
Joey Armstrong | bd667e3 | 2024-04-10 16:54:11 -0400 | [diff] [blame] | 108 | # - repo: https://github.com/PyCQA/doc8 |
| 109 | # rev: v1.1.1 |
| 110 | # hooks: |
| 111 | # - id: doc8 |
| 112 | |
| 113 | ## ----------------------------------------------------------------------- |
| 114 | ## [SOURCE] Testing |
| 115 | ## ----------------------------------------------------------------------- |
| 116 | - repo: https://github.com/MarketSquare/robotframework-tidy |
| 117 | rev: 4.11.0 |
| 118 | hooks: |
| 119 | - id: robotidy |
Joey Armstrong | f2f0a3f | 2024-04-04 15:50:09 -0400 | [diff] [blame] | 120 | |
| 121 | # ------------------------------------------------------------------- |
| 122 | # https://docs.python.org/3/library/re.html#regular-expression-syntax |
| 123 | # ------------------------------------------------------------------- |
| 124 | exclude: | |
| 125 | (?x)^( |
| 126 | ^jjb/.* | |
| 127 | ^makefiles/.* | |
| 128 | ^lf/.* | |
| 129 | ^.venv/.* | |
| 130 | ^jenkins-scripts/.* | |
| 131 | ^lf-ansible/.* | |
| 132 | ^packer/.* | |
| 133 | ^test/.* | |
| 134 | ^jjb/pipeline/voltha/voltha-physical-soak-dt-tests.groovy |
| 135 | )$ |
| 136 | |
| 137 | # [SEE ALSO] |
| 138 | # ----------------------------------------------------------------------- |
| 139 | # https://github.com/memfault/interrupt/blob/master/example/pre-commit/.pre-commit-config.yaml |
| 140 | # https://pre-commit.com/hooks.html |
| 141 | # https://github.com/floatingpurr/sync_with_poetry/blob/main/.pre-commit-config.yaml |
| 142 | # https://github.com/the-common/pre-commit-config-template/blob/master/.pre-commit-config.yaml |
| 143 | # https://github.com/memfault/interrupt/blob/master/example/pre-commit/.pre-commit-config.yaml |
| 144 | # ----------------------------------------------------------------------- |
| 145 | # https://www.hatica.io/blog/pre-commit-git-hooks/ |
| 146 | # ----------------------------------------------------------------------- |
| 147 | |
| 148 | # [EOF] |