Add support for pre-commit hook/linting
.pre-commit-config.yaml
-----------------------
o Create initial config for pre-commit hook.
misc/*
o Basic inline cleanups courtesy of the pre-commit hook.
Signed-off-by: Joey Armstrong <jarmstrong@linuxfoundation.org>
Change-Id: I6aa20216ade22b1a7406e8358864fb245842b713
diff --git a/makefiles/commands/kail/godownloader.sh b/makefiles/commands/kail/godownloader.sh
index 77ad5bf..ee3fbe4 100755
--- a/makefiles/commands/kail/godownloader.sh
+++ b/makefiles/commands/kail/godownloader.sh
@@ -58,7 +58,7 @@
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
test ! -d "${BINDIR}" && install -d "${BINDIR}"
-# shellcheck disable=SC2043
+# shellcheck disable=SC2043
for binexe in "kail" ; do
if [ "$OS" = "windows" ]; then
binexe="${binexe}.exe"
diff --git a/makefiles/docker/config/voltha-openolt-adapter.mk b/makefiles/docker/config/voltha-openolt-adapter.mk
index 98ed2c3..ffbfe1c 100644
--- a/makefiles/docker/config/voltha-openolt-adapter.mk
+++ b/makefiles/docker/config/voltha-openolt-adapter.mk
@@ -22,4 +22,3 @@
# voltha-protos-v5 := /go/src/github.com/opencord/voltha-protos/v5
# [EOF]
-
diff --git a/makefiles/gerrit/include.mk b/makefiles/gerrit/include.mk
index 1c5ad2c..614ab79 100644
--- a/makefiles/gerrit/include.mk
+++ b/makefiles/gerrit/include.mk
@@ -27,7 +27,7 @@
# -----------------------------------------------------------------------
# NOTE: Gerrit ssh targets assume use of ~/.ssh config files
-# port, login, etc are
+# port, login, etc are
# -----------------------------------------------------------------------
# % ssh -p 29418 <username>@gerrit.opencord.org replication list --detail
# % ssh gerrit.opencord.org replication list --detail
diff --git a/makefiles/jjb/include.mk b/makefiles/jjb/include.mk
index 5ada55a..5746d2d 100644
--- a/makefiles/jjb/include.mk
+++ b/makefiles/jjb/include.mk
@@ -32,5 +32,3 @@
endif
# [EOF]
-
-
diff --git a/makefiles/lint/groovy/install.mk b/makefiles/lint/groovy/install.mk
index 8449b74..13830bf 100644
--- a/makefiles/lint/groovy/install.mk
+++ b/makefiles/lint/groovy/install.mk
@@ -46,4 +46,3 @@
@echo ' lint-groovy-install Syntax check groovy sources'
# [EOF]
-
diff --git a/makefiles/lint/jjb.mk b/makefiles/lint/jjb.mk
index 9565363..cfc5eba 100644
--- a/makefiles/lint/jjb.mk
+++ b/makefiles/lint/jjb.mk
@@ -44,7 +44,7 @@
lint-jjb-args += jjb/# # JJB config sources (input)
lint-jjb-deps := $(null)
-lint-jjb-deps += $(venv-activate-script)
+lint-jjb-deps += $(venv-activate-script)
lint-jjb-deps += checkout-ci-management-sub-modules
lint-jjb: $(lint-jjb-deps)
$(activate) && { jenkins-jobs $(lint-jjb-args); }
diff --git a/makefiles/lint/json.mk b/makefiles/lint/json.mk
index 4c63f88..9d0088f 100644
--- a/makefiles/lint/json.mk
+++ b/makefiles/lint/json.mk
@@ -43,7 +43,7 @@
## -----------------------------------------------------------------------
json-find-args := $(null)
json-find-args += -name '$(venv-name)'
-lint-json-all:
+lint-json-all:
$(HIDE)$(MAKE) --no-print-directory lint-json-install
$(activate)\
diff --git a/makefiles/lint/yaml/.yamllint b/makefiles/lint/yaml/.yamllint
index 8252511..db8c14d 100644
--- a/makefiles/lint/yaml/.yamllint
+++ b/makefiles/lint/yaml/.yamllint
@@ -1,6 +1,6 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
+# Copyright 2022-2024 Open Networking Foundation (ONF) Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,10 +13,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-# SPDX-FileCopyrightText: 2024 Open Networking Foundation (ONF) and the ONF Contributors
+# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2024 Open Networking Foundation Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
+
---
yaml-files:
@@ -30,7 +31,8 @@
max: 160
# -----------------------------------------------------------------------
-# .. seealso: https://gerrit.opencord.org/plugins/gitiles/helm-repo-tools/+/refs/heads/master/yamllint.conf
+# .. seealso: https://gerrit.opencord.org/plugins/gitiles/
+# helm-repo-tools/+/refs/heads/master/yamllint.conf
# -----------------------------------------------------------------------
#
# extends: default
@@ -43,3 +45,4 @@
# braces:
# min-spaces-inside: 0
# max-spaces-inside: 1
+# -----------------------------------------------------------------------
diff --git a/makefiles/lint/yaml/byrepo/ci-management/yamllint.conf b/makefiles/lint/yaml/byrepo/ci-management/yamllint.conf
index 32d76ab..b821cb8 100644
--- a/makefiles/lint/yaml/byrepo/ci-management/yamllint.conf
+++ b/makefiles/lint/yaml/byrepo/ci-management/yamllint.conf
@@ -5,4 +5,3 @@
max-end: 1
line-length:
max: 120
-
diff --git a/makefiles/lint/yaml/byrepo/voltha-lib-go/repo b/makefiles/lint/yaml/byrepo/voltha-lib-go/repo
index 99e8451..7011a2c 100644
--- a/makefiles/lint/yaml/byrepo/voltha-lib-go/repo
+++ b/makefiles/lint/yaml/byrepo/voltha-lib-go/repo
@@ -1 +1 @@
-Source from voltha-lib-go
\ No newline at end of file
+Source from voltha-lib-go
diff --git a/makefiles/lint/yaml/byrepo/voltha-lib-go/urls b/makefiles/lint/yaml/byrepo/voltha-lib-go/urls
index 8747658..7609256 100644
--- a/makefiles/lint/yaml/byrepo/voltha-lib-go/urls
+++ b/makefiles/lint/yaml/byrepo/voltha-lib-go/urls
@@ -2,4 +2,4 @@
https://yamllint.readthedocs.io/en/stable/configuration.html
-# [EOF]
\ No newline at end of file
+# [EOF]
diff --git a/makefiles/release/include.mk b/makefiles/release/include.mk
index 6c56261..0e2ae31 100644
--- a/makefiles/release/include.mk
+++ b/makefiles/release/include.mk
@@ -32,5 +32,3 @@
endif
# [EOF]
-
-
diff --git a/makefiles/release/voltha-versions.mk b/makefiles/release/voltha-versions.mk
index b8977dc..6bc7874 100644
--- a/makefiles/release/voltha-versions.mk
+++ b/makefiles/release/voltha-versions.mk
@@ -36,7 +36,7 @@
# fatal to make help (param is null)
voltha-version ?= $(error $(MAKE) voltha-verison=voltha-x.yy is required)\
-voltha-release-this := $(word 1,$(voltha-versions))
+voltha-release-this := $(word 1,$(voltha-versions))
voltha-release-last := $(word 2,$(voltha-versions))
$(if $(DEBUG),$(warning LEAVE))