blob: d764883864c7d013f95dd61c2ff986c76327d9b8 [file] [log] [blame]
Joey Armstrong9886cc82024-04-04 11:34:51 -04001---
2
3# -----------------------------------------------------------------------
Joey Armstrong342430f2024-04-10 10:36:34 -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# -----------------------------------------------------------------------
Joey Armstrong42c2a642024-04-18 15:44:43 -040012# [HOOKS: disabled]
13# - reuse
14# -----------------------------------------------------------------------
Joey Armstrong342430f2024-04-10 10:36:34 -040015
16# -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -040017# 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 Armstrong342430f2024-04-10 10:36:34 -040023# http://www.apache.org/licenses/LICENSE-2.0
Joey Armstrong9886cc82024-04-04 11:34:51 -040024#
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 Armstrong342430f2024-04-10 10:36:34 -040037# .pre-commit-config-yaml 2024-04-10 v0.3
Joey Armstrong9886cc82024-04-04 11:34:51 -040038# -----------------------------------------------------------------------
39
Joey Armstrong342430f2024-04-10 10:36:34 -040040# ci:
41# skip: [sync]
42
Joey Armstrong9886cc82024-04-04 11:34:51 -040043repos:
Joey Armstrong342430f2024-04-10 10:36:34 -040044 # Sync from repo
45 - repo: https://github.com/pre-commit/pre-commit-hooks
Joey Armstrong9886cc82024-04-04 11:34:51 -040046 rev: v4.5.0
47 hooks:
48 - id: trailing-whitespace
49 - id: end-of-file-fixer
50 - id: check-yaml
51 - id: check-added-large-files
Joey Armstrong342430f2024-04-10 10:36:34 -040052
53 - repo: https://github.com/koalaman/shellcheck-precommit
Joey Armstrong9886cc82024-04-04 11:34:51 -040054 rev: v0.10.0
55 hooks:
56 - id: shellcheck
Joey Armstrong342430f2024-04-10 10:36:34 -040057
58 - repo: https://github.com/adrienverge/yamllint.git
Joey Armstrong9886cc82024-04-04 11:34:51 -040059 rev: v1.35.1
60 hooks:
61 - id: yamllint
62
63## -----------------------------------------------------------------------
Joey Armstrong342430f2024-04-10 10:36:34 -040064## [SOURCE] REUSE License Checking
65## -----------------------------------------------------------------------
Joey Armstrong42c2a642024-04-18 15:44:43 -040066# - repo: https://github.com/fsfe/reuse-tool
67# rev: v3.0.2
68# hooks:
69# - id: reuse
Joey Armstrong342430f2024-04-10 10:36:34 -040070# - id: add-license-headers
71# args:
72# - --custom_copyright=custom copyright phrase
73# - --custom_template=template_name
74# - --custom_license=license_name
75# - --ignore_license_check
76# - --start_year=2023
77
78## -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -040079## [SOURCE] Python
80## -----------------------------------------------------------------------
Joey Armstrong42c2a642024-04-18 15:44:43 -040081
Joey Armstrong342430f2024-04-10 10:36:34 -040082# - repo: https://github.com/psf/black
83# rev: 22.10.0
84# hooks:
85# - id: black
Joey Armstrong9886cc82024-04-04 11:34:51 -040086
Joey Armstrong42c2a642024-04-18 15:44:43 -040087 - repo: https://github.com/PyCQA/doc8
88 rev: v1.1.1
89 hooks:
90 - id: doc8
91
92 - repo: https://github.com/pre-commit/pygrep-hooks
93 rev: v1.10.0
94 hooks:
95 - id: rst-backticks
96 - id: rst-directive-colons
97 - id: rst-inline-touching-normal
Joey Armstrong342430f2024-04-10 10:36:34 -040098
Joey Armstrong9886cc82024-04-04 11:34:51 -040099# -------------------------------------------------------------------
100# https://docs.python.org/3/library/re.html#regular-expression-syntax
101# -------------------------------------------------------------------
102exclude: |
103 (?x)^(
104 ^jjb/.* |
105 ^makefiles/.* |
106 ^lf/.* |
107 ^.venv/.* |
Joey Armstrong342430f2024-04-10 10:36:34 -0400108 ^jenkins-scripts/.* |
109 ^lf-ansible/.* |
110 ^packer/.* |
111 ^test/.* |
112 ^jjb/pipeline/voltha/voltha-physical-soak-dt-tests.groovy
Joey Armstrong9886cc82024-04-04 11:34:51 -0400113 )$
114
115# [SEE ALSO]
116# -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -0400117
118# [EOF]