From 789fb6f9d232df83e9895a71c753b6d4cb28bb80 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 12 Mar 2026 17:44:56 +1000 Subject: [PATCH 1/3] ci: add pre-commit configuration and yamllint Add pre-commit hooks for code quality enforcement: - trailing-whitespace, end-of-file-fixer, check-yaml/xml/json - shellcheck for bash scripts - prettier for yaml/markdown formatting - yamllint with 120-char line length Change-Id: Icbd82b07c53b341a65d381cadc5eb3685c72c5dc Signed-off-by: Anil Belur Signed-off-by: Anil Belur --- .pre-commit-config.yaml | 54 +++++++++++++++++++++++++++++++++++++++++ .yamllint | 21 ++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .yamllint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..65a634ff --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,54 @@ +--- +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2026 The Linux Foundation + +# Pre-commit hooks for OpenDaylight projects +# Install: pip install pre-commit && pre-commit install +# Run: pre-commit run --all-files + +default_language_version: + python: python3 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 + hooks: + - id: trailing-whitespace + exclude: '^.*\.(bin|patch|diff)$' + - id: end-of-file-fixer + exclude: '^.*\.(bin|patch|diff)$' + - id: check-yaml + args: [--allow-multiple-documents] + - id: check-xml + - id: check-json + - id: check-added-large-files + args: ["--maxkb=10240"] # 10MB + - id: check-merge-conflict + - id: check-case-conflict + - id: mixed-line-ending + args: ["--fix=lf"] + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: a30f0d816e5062a67d87c8de753cfe499672b959 # frozen: v1.5.5 + hooks: + - id: remove-tabs + exclude: '^(.*\.go|.*\.bin|docs/make.bat|docs/Makefile|.*\.patch|.*\.diff)$' + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: a23f6b85d0fdd5bb9d564e2579e678033debbdff # frozen: v0.10.0.1 + hooks: + - id: shellcheck + args: ["-x", "--severity=warning"] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8 + hooks: + - id: prettier + types_or: [yaml, markdown] + exclude: '^(.*\.template|.*\.patch|.*\.diff)$' + + - repo: https://github.com/adrienverge/yamllint + rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # frozen: v1.35.1 + hooks: + - id: yamllint + args: ["-c", ".yamllint"] diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..0c1b13ab --- /dev/null +++ b/.yamllint @@ -0,0 +1,21 @@ +--- +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2026 The Linux Foundation + +# yamllint configuration for OpenDaylight projects + +extends: default + +rules: + line-length: + max: 120 + level: warning + indentation: + spaces: 2 + indent-sequences: true + comments: + min-spaces-from-content: 1 + comments-indentation: {} + document-start: disable + truthy: + allowed-values: ['true', 'false', 'yes', 'no'] -- 2.34.1 From 059803fa8743873e8e60000c46e6920f7260d140 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 12 Mar 2026 17:45:23 +1000 Subject: [PATCH 2/3] ci: apply pre-commit formatting fixes Apply formatting fixes identified by pre-commit hooks: - prettier: reformat INFO.yaml - trailing-whitespace: fix docs and xml files - end-of-file-fixer: fix missing newlines - shellcheck warnings noted (not auto-fixed) Change-Id: I58b008e1c4b473adf19bd5fd25ce583541d92c85 Signed-off-by: Anil Belur Signed-off-by: Anil Belur --- INFO.yaml | 96 +++++++++---------- docs/platform-versions.rst | 2 - .../src/main/assembly/bin/set_persistence.sh | 1 - .../assembly/etc/org.ops4j.pax.url.mvn.cfg | 2 +- onap-karaf/pom.xml | 1 - 5 files changed, 49 insertions(+), 53 deletions(-) diff --git a/INFO.yaml b/INFO.yaml index 1c5018a3..47684728 100644 --- a/INFO.yaml +++ b/INFO.yaml @@ -1,58 +1,58 @@ --- -project: 'integration' -project_creation_date: '2015-08-20' -project_category: '' -lifecycle_state: 'Incubation' +project: "integration" +project_creation_date: "2015-08-20" +project_category: "" +lifecycle_state: "Incubation" project_lead: &odl_integration_ptl - name: 'Luis Gomez' - email: 'ecelgp@gmail.com' - company: 'Lumina Networks' - id: 'ecelgp' - timezone: 'Americas/Los_Angeles' + name: "Luis Gomez" + email: "ecelgp@gmail.com" + company: "Lumina Networks" + id: "ecelgp" + timezone: "Americas/Los_Angeles" primary_contact: *odl_integration_ptl issue_tracking: - type: 'jira' - url: 'https://jira.opendaylight.org/projects/' - key: 'integration' + type: "jira" + url: "https://jira.opendaylight.org/projects/" + key: "integration" mailing_list: - type: 'groups.io' - url: 'integration-dev@lists.opendaylight.org' - tag: '[]' + type: "groups.io" + url: "integration-dev@lists.opendaylight.org" + tag: "[]" realtime_discussion: - type: 'irc' - server: 'freenode.net' - channel: '#opendaylight' + type: "irc" + server: "freenode.net" + channel: "#opendaylight" meetings: - - type: 'gotomeeting+irc' - agenda: 'https://wiki.opendaylight.org' - url: '' - server: 'freenode.net' - channel: '#opendaylight' - repeats: '' - time: '' + - type: "gotomeeting+irc" + agenda: "https://wiki.opendaylight.org" + url: "" + server: "freenode.net" + channel: "#opendaylight" + repeats: "" + time: "" repositories: - - integration + - integration committers: - - <<: *odl_integration_ptl - - name: 'Thanh Ha (zxiiro)' - email: 'zxiiro@gmail.com' - company: 'Lumina Networks' - id: 'zxiiro' - timezone: 'Americas/Toronto' - - name: 'Anil Belur' - email: 'abelur@linuxfoundation.org' - company: 'Linux Foundation' - id: 'askb' - timezone: 'Unknown/Unknown' - - name: 'Jamo Luhrsen' - email: 'jluhrsen@gmail.com' - company: 'Lumina Networks' - id: 'jluhrsen' - timezone: 'Americas/Los_Angeles' + - <<: *odl_integration_ptl + - name: "Thanh Ha (zxiiro)" + email: "zxiiro@gmail.com" + company: "Lumina Networks" + id: "zxiiro" + timezone: "Americas/Toronto" + - name: "Anil Belur" + email: "abelur@linuxfoundation.org" + company: "Linux Foundation" + id: "askb" + timezone: "Unknown/Unknown" + - name: "Jamo Luhrsen" + email: "jluhrsen@gmail.com" + company: "Lumina Networks" + id: "jluhrsen" + timezone: "Americas/Los_Angeles" tsc: - # yamllint disable rule:line-length - approval: 'https://meetings.opendaylight.org/meetings/opendaylight-meeting/2015/tsc/opendaylight-meeting-tsc.2015-08-20-17.00.html' - changes: - - type: '' - name: '' - link: '' + # yamllint disable rule:line-length + approval: "https://meetings.opendaylight.org/meetings/opendaylight-meeting/2015/tsc/opendaylight-meeting-tsc.2015-08-20-17.00.html" + changes: + - type: "" + name: "" + link: "" diff --git a/docs/platform-versions.rst b/docs/platform-versions.rst index 7fca08c8..7056cd70 100644 --- a/docs/platform-versions.rst +++ b/docs/platform-versions.rst @@ -47,5 +47,3 @@ Platform versions ${project}-artifacts are maven `bill of materials `__ (a.k.a. bom or BOM), whose use is strongly recommended to avoid versions mismatch across multiple dependencies in poms. - - diff --git a/karaf-scripts/src/main/assembly/bin/set_persistence.sh b/karaf-scripts/src/main/assembly/bin/set_persistence.sh index 15c22717..21ce225a 100755 --- a/karaf-scripts/src/main/assembly/bin/set_persistence.sh +++ b/karaf-scripts/src/main/assembly/bin/set_persistence.sh @@ -108,4 +108,3 @@ function main main "$@" # vim: ts=4 sw=4 sts=4 et ft=sh : - diff --git a/karaf-scripts/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg b/karaf-scripts/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg index cdd58378..be7fa3eb 100644 --- a/karaf-scripts/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg +++ b/karaf-scripts/src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg @@ -93,4 +93,4 @@ org.ops4j.pax.url.mvn.defaultRepositories=\ # org.ops4j.pax.url.mvn.repositories= -### ^^^ No remote repositories. This is the only ODL change compared to Karaf defaults. \ No newline at end of file +### ^^^ No remote repositories. This is the only ODL change compared to Karaf defaults. diff --git a/onap-karaf/pom.xml b/onap-karaf/pom.xml index 90e53845..878ca1b3 100644 --- a/onap-karaf/pom.xml +++ b/onap-karaf/pom.xml @@ -172,4 +172,3 @@ - -- 2.34.1 From 68d9e476756ff8cb358a269ff2e8939899ad135e Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Thu, 12 Mar 2026 07:51:49 +0000 Subject: [PATCH 3/3] Release Validate --- artifacts/all/pom.xml | 2 +- artifacts/distribution/pom.xml | 2 +- artifacts/pom.xml | 2 +- artifacts/upstream/all/pom.xml | 2 +- artifacts/upstream/artifacts/pom.xml | 2 +- artifacts/upstream/other/pom.xml | 2 +- artifacts/upstream/pom.xml | 2 +- artifacts/upstream/properties/pom.xml | 10 +++++----- features/pom.xml | 2 +- features/repos/index/pom.xml | 2 +- features/repos/pom.xml | 2 +- features/repos/test/pom.xml | 2 +- features/singles/odl-integration-all/pom.xml | 2 +- .../odl-integration-compatible-with-all/pom.xml | 2 +- features/singles/pom.xml | 2 +- karaf-scripts/pom.xml | 2 +- karaf/pom.xml | 6 +++--- onap-karaf/pom.xml | 2 +- pom.xml | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) diff --git a/artifacts/all/pom.xml b/artifacts/all/pom.xml index 4abfacce..ef1261bf 100644 --- a/artifacts/all/pom.xml +++ b/artifacts/all/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration all-artifacts - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/artifacts/distribution/pom.xml b/artifacts/distribution/pom.xml index d059c325..f7a9b4b3 100644 --- a/artifacts/distribution/pom.xml +++ b/artifacts/distribution/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration distribution-artifacts - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 41ee9da3..1fdf3ae8 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration artifacts-aggregator - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/artifacts/upstream/all/pom.xml b/artifacts/upstream/all/pom.xml index 2311dc6e..0ab72017 100644 --- a/artifacts/upstream/all/pom.xml +++ b/artifacts/upstream/all/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration upstream-all-artifacts - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/artifacts/upstream/artifacts/pom.xml b/artifacts/upstream/artifacts/pom.xml index 55a5a4e5..3154677a 100644 --- a/artifacts/upstream/artifacts/pom.xml +++ b/artifacts/upstream/artifacts/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.integration properties - 0.24.0-SNAPSHOT + 0.24.0 ../properties artifact-artifacts diff --git a/artifacts/upstream/other/pom.xml b/artifacts/upstream/other/pom.xml index af29b0d8..eb22eb60 100644 --- a/artifacts/upstream/other/pom.xml +++ b/artifacts/upstream/other/pom.xml @@ -14,7 +14,7 @@ org.opendaylight.integration properties - 0.24.0-SNAPSHOT + 0.24.0 ../properties other-artifacts diff --git a/artifacts/upstream/pom.xml b/artifacts/upstream/pom.xml index 9052792e..5a89a255 100644 --- a/artifacts/upstream/pom.xml +++ b/artifacts/upstream/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration upstream-aggregator - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/artifacts/upstream/properties/pom.xml b/artifacts/upstream/properties/pom.xml index 1d07f990..e079361c 100644 --- a/artifacts/upstream/properties/pom.xml +++ b/artifacts/upstream/properties/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration properties - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/features/repos/index/pom.xml b/features/repos/index/pom.xml index cc15bab8..4fcae45a 100644 --- a/features/repos/index/pom.xml +++ b/features/repos/index/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration features-index - 0.24.0-SNAPSHOT + 0.24.0 feature diff --git a/features/repos/pom.xml b/features/repos/pom.xml index c152c086..6da3e384 100644 --- a/features/repos/pom.xml +++ b/features/repos/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration repos-aggregator - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/features/repos/test/pom.xml b/features/repos/test/pom.xml index bda4b5d9..f159eeac 100644 --- a/features/repos/test/pom.xml +++ b/features/repos/test/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration features-test - 0.24.0-SNAPSHOT + 0.24.0 feature diff --git a/features/singles/odl-integration-all/pom.xml b/features/singles/odl-integration-all/pom.xml index 6ba7ff44..d68eddc2 100644 --- a/features/singles/odl-integration-all/pom.xml +++ b/features/singles/odl-integration-all/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration odl-integration-all - 0.24.0-SNAPSHOT + 0.24.0 feature diff --git a/features/singles/odl-integration-compatible-with-all/pom.xml b/features/singles/odl-integration-compatible-with-all/pom.xml index 25e88784..0d6a920b 100644 --- a/features/singles/odl-integration-compatible-with-all/pom.xml +++ b/features/singles/odl-integration-compatible-with-all/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration odl-integration-compatible-with-all - 0.24.0-SNAPSHOT + 0.24.0 feature diff --git a/features/singles/pom.xml b/features/singles/pom.xml index 5bc5d311..0948337d 100644 --- a/features/singles/pom.xml +++ b/features/singles/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration singles-aggregator - 0.24.0-SNAPSHOT + 0.24.0 pom diff --git a/karaf-scripts/pom.xml b/karaf-scripts/pom.xml index 8cfbcae3..b32ca3cd 100644 --- a/karaf-scripts/pom.xml +++ b/karaf-scripts/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration karaf-scripts - 0.24.0-SNAPSHOT + 0.24.0 jar ODL :: integration :: Karaf :: Scripts :: ${project.artifactId} The actual Karaf archive building sub-project. diff --git a/karaf/pom.xml b/karaf/pom.xml index 07ba3017..54721b72 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -18,7 +18,7 @@ org.opendaylight.integration karaf - 0.24.0-SNAPSHOT + 0.24.0 pom @@ -43,7 +43,7 @@ org.opendaylight.integration all-artifacts - 0.24.0-SNAPSHOT + 0.24.0 import pom @@ -97,7 +97,7 @@ org.opendaylight.integration karaf-scripts - 0.24.0-SNAPSHOT + 0.24.0 test diff --git a/onap-karaf/pom.xml b/onap-karaf/pom.xml index 878ca1b3..bbcfd2f0 100644 --- a/onap-karaf/pom.xml +++ b/onap-karaf/pom.xml @@ -10,7 +10,7 @@ org.opendaylight.integration onap-karaf - 0.24.0-SNAPSHOT + 0.24.0 pom ODL :: integration :: ${project.artifactId} 4.0.0 diff --git a/pom.xml b/pom.xml index 8184e072..09044711 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.integration distribution-aggregator - 0.24.0-SNAPSHOT + 0.24.0 pom Integration/Distribution -- 2.34.1