.pre-commit-config.yaml
-----------------------
o Cleanup linting errors.
protoset.go
-----------
o Update copyright notice to correct linting errors.
.reuse/
LICENSE/
--------
o Add configs for reuse license checking.
tox.ini
-------
o Add python3.8 as an accepted interprepter.
.reuse/
LICENSES/
---------
o Add basic configs for using the reuse license checking tool.
Change-Id: I2df2dc1c7043d6beae1427c41769921c49cf2913
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3accce7..ee6a665 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -3,6 +3,10 @@
# -----------------------------------------------------------------------
# [NOTE] - Propogate .pre-commit-config.yaml edits to all repositories!
# -----------------------------------------------------------------------
+# [NOTE] - Common config file source lives in repo:onf-make
+# - https://gerrit.opencord.org/plugins/gitiles/
+# onf-make/+/refs/heads/master/.pre-commit-config.yaml
+# -----------------------------------------------------------------------
# [TODO]
# - pre-commit yaml config exists individually within repositories.
# - Generally lint config and benavior is consistent for all repos.
@@ -31,10 +35,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# -----------------------------------------------------------------------
-# .pre-commit-config-yaml 2024-04-19 v0.4
+# .pre-commit-config-yaml v0.7 (2024-06-13)
# -----------------------------------------------------------------------
-#ci:
+# ci:
# autofix_commit_msg: "Chore: pre-commit autoupdate"
## skip: [sync]
# skip:
@@ -45,7 +49,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
-# rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
@@ -55,10 +58,10 @@
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
-# - id: debug-statements
+ # - id: debug-statements
- id: end-of-file-fixer
- id: fix-encoding-pragma
-# - id: double-quote-string-fixer
+ # - id: double-quote-string-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=lf']
@@ -78,9 +81,9 @@
hooks:
- id: yamllint
-## -----------------------------------------------------------------------
-## [SOURCE] Documentation
-## -----------------------------------------------------------------------
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Documentation
+ ## -----------------------------------------------------------------------
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.1
hooks:
@@ -90,61 +93,70 @@
rev: v0.13.0
hooks:
- id: markdownlint
-# - id: markdownlint_docker
+ # - id: markdownlint_docker
-## -----------------------------------------------------------------------
-## [SOURCE] Docker
-## -----------------------------------------------------------------------
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Docker
+ ## -----------------------------------------------------------------------
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- - id: hadolint
-# - id: hadolint-docker
+ # - id: hadolint # local tool install
+ - id: hadolint-docker
-## -----------------------------------------------------------------------
-## [SOURCE] Golang
-## -----------------------------------------------------------------------
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Golang
+ ## -----------------------------------------------------------------------
- repo: https://github.com/golangci/golangci-lint
rev: v1.41.1
hooks:
- id: golangci-lint
-## -----------------------------------------------------------------------
-## [SOURCE] REUSE License Checking
-## -----------------------------------------------------------------------
-# - repo: https://github.com/fsfe/reuse-tool
-# rev: v3.0.2
-# hooks:
-# - id: reuse
-# - id: add-license-headers
-#
-# - repo: https://github.com/ansys/pre-commit-hooks
-# rev: v0.2.9
-# hooks:
-# - id: add-license-headers
-# args:
-# - --custom_copyright=custom copyright phrase
-# - --custom_template=template_name
-# - --custom_license=license_name
-# - --ignore_license_check
-# - --start_year=2023
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] REUSE License Checking
+ ## -----------------------------------------------------------------------
+ ## tox -e [style,py,py-coverage,doc]
+ ## -----------------------------------------------------------------------
+ - repo: https://github.com/fsfe/reuse-tool
+ rev: v3.0.2
+ hooks:
+ - id: reuse
-## -----------------------------------------------------------------------
-## [SOURCE] Python
-## -----------------------------------------------------------------------
-# - repo: https://github.com/psf/black
-# rev: 22.10.0
-# hooks:
-# - id: black
+ - repo: https://github.com/ansys/pre-commit-hooks
+ rev: v0.2.9
+ hooks:
+ - id: add-license-headers
+ args:
+ - --custom_copyright=Open Networking Foundation Contributors
+ - --custom_template=open_networking_foundation
+ - --custom_license=Apache-2.0
+ # - --ignore_license_check
+ - --start_year=2019
+
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Python
+ ## -----------------------------------------------------------------------
+ - repo: https://github.com/psf/black
+ rev: 22.10.0
+ hooks:
+ - id: black
# - repo: https://github.com/PyCQA/doc8
-# rev: v1.1.1
-# hooks:
-# - id: doc8
+ # rev: v1.1.1
+ # hooks:
+ # - id: doc8
-## -----------------------------------------------------------------------
-## [SOURCE] Testing
-## -----------------------------------------------------------------------
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Spelling
+ ## -----------------------------------------------------------------------
+ - repo: https://github.com/codespell-project/codespell
+ rev: v2.2.4
+ hooks:
+ - id: codespell
+
+ ## -----------------------------------------------------------------------
+ ## [SOURCE] Testing
+ ## -----------------------------------------------------------------------
- repo: https://github.com/MarketSquare/robotframework-tidy
rev: 4.11.0
hooks:
@@ -152,12 +164,24 @@
# -------------------------------------------------------------------
# https://docs.python.org/3/library/re.html#regular-expression-syntax
+# https://pre-commit.com/#top_level-exclude
+# -------------------------------------------------------------------
+# [TODO] add file patterns per-repository:
+# .gitignore: *~ *\#*
+# -------------------------------------------------------------------
+# [TODO]
+# o Remove vendor/ post copyright cleanup
+# o https://pre-commit.com/#filtering-files-with-types
# -------------------------------------------------------------------
exclude: |
(?x)^(
- ^makefiles/.* |
- ^lf/.* |
- ^.venv/.* |
+ ^VERSION |
+ ^makefiles/.* |
+ ^lf/.* |
+ ^.venv/.* |
+ ^.vendor/.* |
+ ^______FIX_BELOW_______ |
+ ^vendor/ |
^ignore-end-of-exclude-marker
)$