blob: ab85bb6a4df7c4385e38e2cb91085117ba9b717e [file] [log] [blame]
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -04001---
2
3# -----------------------------------------------------------------------
Joey Armstrongbd667e32024-04-10 16:54:11 -04004# [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 Armstrongf2f0a3f2024-04-04 15:50:09 -040014# 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 Armstrongbd667e32024-04-10 16:54:11 -040020# http://www.apache.org/licenses/LICENSE-2.0
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040021#
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 Armstrongbd667e32024-04-10 16:54:11 -040034# .pre-commit-config-yaml 2024-04-10 v0.3
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040035# -----------------------------------------------------------------------
36
Joey Armstrongbd667e32024-04-10 16:54:11 -040037# ci:
38# skip: [sync]
39
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040040repos:
Joey Armstrongbd667e32024-04-10 16:54:11 -040041 # Sync from repo
42 - repo: https://github.com/pre-commit/pre-commit-hooks
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040043 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 Armstrongbd667e32024-04-10 16:54:11 -040049# - id: fix-encoding-pragma
50# - id: double-quote-string-fixer
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040051
Joey Armstrongbd667e32024-04-10 16:54:11 -040052 - repo: https://github.com/koalaman/shellcheck-precommit
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040053 rev: v0.10.0
54 hooks:
55 - id: shellcheck
56
Joey Armstrongbd667e32024-04-10 16:54:11 -040057 - repo: https://github.com/adrienverge/yamllint.git
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040058 rev: v1.35.1
59 hooks:
60 - id: yamllint
61
62## -----------------------------------------------------------------------
Joey Armstrongbd667e32024-04-10 16:54:11 -040063## [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 Armstrongf2f0a3f2024-04-04 15:50:09 -040087## [SOURCE] REUSE License Checking
88## -----------------------------------------------------------------------
89# - repo: https://github.com/ansys/pre-commit-hooks
Joey Armstrongbd667e32024-04-10 16:54:11 -040090# rev: v0.2.9
91# hooks:
92# - id: add-license-headers
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -040093# args:
94# - --custom_copyright=custom copyright phrase
95# - --custom_template=template_name
96# - --custom_license=license_name
97# - --ignore_license_check
Joey Armstrongbd667e32024-04-10 16:54:11 -040098# - --start_year=2023
99
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -0400100## -----------------------------------------------------------------------
101## [SOURCE] Python
102## -----------------------------------------------------------------------
Joey Armstrongbd667e32024-04-10 16:54:11 -0400103# - repo: https://github.com/psf/black
104# rev: 22.10.0
105# hooks:
106# - id: black
Joey Armstrongf2f0a3f2024-04-04 15:50:09 -0400107
Joey Armstrongbd667e32024-04-10 16:54:11 -0400108# - 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 Armstrongf2f0a3f2024-04-04 15:50:09 -0400120
121# -------------------------------------------------------------------
122# https://docs.python.org/3/library/re.html#regular-expression-syntax
123# -------------------------------------------------------------------
124exclude: |
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]