blob: b9bf768040004ac79774375c140318080abde3e8 [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# -----------------------------------------------------------------------
12
13# -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -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 Armstrong342430f2024-04-10 10:36:34 -040020# http://www.apache.org/licenses/LICENSE-2.0
Joey Armstrong9886cc82024-04-04 11:34:51 -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 Armstrong342430f2024-04-10 10:36:34 -040034# .pre-commit-config-yaml 2024-04-10 v0.3
Joey Armstrong9886cc82024-04-04 11:34:51 -040035# -----------------------------------------------------------------------
36
Joey Armstrong342430f2024-04-10 10:36:34 -040037# ci:
38# skip: [sync]
39
Joey Armstrong9886cc82024-04-04 11:34:51 -040040repos:
Joey Armstrong342430f2024-04-10 10:36:34 -040041 # Sync from repo
42 - repo: https://github.com/pre-commit/pre-commit-hooks
Joey Armstrong9886cc82024-04-04 11:34:51 -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 Armstrong342430f2024-04-10 10:36:34 -040049
50 - repo: https://github.com/koalaman/shellcheck-precommit
Joey Armstrong9886cc82024-04-04 11:34:51 -040051 rev: v0.10.0
52 hooks:
53 - id: shellcheck
Joey Armstrong342430f2024-04-10 10:36:34 -040054
55 - repo: https://github.com/adrienverge/yamllint.git
Joey Armstrong9886cc82024-04-04 11:34:51 -040056 rev: v1.35.1
57 hooks:
58 - id: yamllint
59
60## -----------------------------------------------------------------------
Joey Armstrong342430f2024-04-10 10:36:34 -040061## [SOURCE] REUSE License Checking
62## -----------------------------------------------------------------------
63# - repo: https://github.com/ansys/pre-commit-hooks
64# rev: v0.2.9
65# hooks:
66# - id: add-license-headers
67# args:
68# - --custom_copyright=custom copyright phrase
69# - --custom_template=template_name
70# - --custom_license=license_name
71# - --ignore_license_check
72# - --start_year=2023
73
74## -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -040075## [SOURCE] Python
76## -----------------------------------------------------------------------
Joey Armstrong342430f2024-04-10 10:36:34 -040077# - repo: https://github.com/psf/black
78# rev: 22.10.0
79# hooks:
80# - id: black
Joey Armstrong9886cc82024-04-04 11:34:51 -040081
Joey Armstrong342430f2024-04-10 10:36:34 -040082# - repo: https://github.com/PyCQA/doc8
83# rev: v1.1.1
84# hooks:
85# - id: doc8
86
Joey Armstrong9886cc82024-04-04 11:34:51 -040087# -------------------------------------------------------------------
88# https://docs.python.org/3/library/re.html#regular-expression-syntax
89# -------------------------------------------------------------------
90exclude: |
91 (?x)^(
92 ^jjb/.* |
93 ^makefiles/.* |
94 ^lf/.* |
95 ^.venv/.* |
Joey Armstrong342430f2024-04-10 10:36:34 -040096 ^jenkins-scripts/.* |
97 ^lf-ansible/.* |
98 ^packer/.* |
99 ^test/.* |
100 ^jjb/pipeline/voltha/voltha-physical-soak-dt-tests.groovy
Joey Armstrong9886cc82024-04-04 11:34:51 -0400101 )$
102
103# [SEE ALSO]
104# -----------------------------------------------------------------------
Joey Armstrong9886cc82024-04-04 11:34:51 -0400105
106# [EOF]