[VOL-5064] - Build and deploy voltha-system-tests
makefiles/
----------
o Copy in latest library makefiles from repo:onf-make
config.mk
makefiles/lint
--------------
o Support more lint targets
makefiles/virtualenv.mk
-----------------------
o Update to use library logic.
o Install/maintain .venv/ VS vst_venv.
o Proper dependency driven create when needed VS always install.
o Also support replacing inlined venv logic with library makefile logs.
makefiles/commands/kail.mk
--------------------------
o mkdir -p for interactive use when WORKSPACE= is set.
Makefile
--------
o Inline comment delimiters and help targets to improve readabilty.
o Call macro banner-enter/banner-leave to hilight target output.
o Change targets clean and help into double-colon rules so they
are included when library targets are processed.
o Update include $(MAKEDIR) imports, library makefiles are able to infer paths
and define MAKDIR=, ONF_MAKEDIR=.
o Define helper macro run-robot-test= allowing copy & paste robot command
line to be refactored and reduced.
o Define local target 'venv-install' allowing installation of the virtualenv
followed by patching so a newer interpreter can be used locally for testing.
o Shell command separator: replace ';' with '&&' to improve error detection.
o target=gendocs: Split run-on command line into independent steps, activate
script only applies to the for loop invoking tests.
Change-Id: Idc8efd89f36b9f4954d9394a6524e07aa2ea5531
diff --git a/makefiles/lint/doc8/include.mk b/makefiles/lint/doc8/include.mk
index 86f9677..23f7b0b 100644
--- a/makefiles/lint/doc8/include.mk
+++ b/makefiles/lint/doc8/include.mk
@@ -49,7 +49,7 @@
$(activate) && doc8 --version
@echo
$(activate) && doc8 $(lint-doc8-excl)
- $(call banner-leave,Target $@)
+ $(call banner-enter,Target $@)
## -----------------------------------------------------------------------
## Intent: Display command usage
diff --git a/makefiles/lint/docker/get.sh b/makefiles/lint/docker/get.sh
new file mode 100644
index 0000000..4e4a7f6
--- /dev/null
+++ b/makefiles/lint/docker/get.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent: Install a bbsim binary for local development use.
+## -----------------------------------------------------------------------
+## Note: A python or golang script may be a simpler answer.
+## Interpreter modules provide answers for uname -{a,m,o}
+## with dictionary translation into needed values.
+## -----------------------------------------------------------------------
+
+# import platform
+# platform.processor()
+# platform.system # Windows
+
+# lshw: width: 64 bits
+
+# >>> import platform
+# >>> platform.machine()
+# 'x86'
+
+
+# $ uname -m
+# armv7l
+
+## which arch
+# https://github.com/hadolint/hadolint/releases/tag/v2.12.0
+case "$(uname -a)" in
+ *x86_64*)
+esac
+
+os=''
+case "$(uname -o)" in
+ *Linux*) os='Linux'
+esac
+
+
+# hadolint-Darwin-x86_64
+# hadolint-Darwin-x86_64.sha256
+# hadolint-Linux-arm64
+# hadolint-Linux-arm64.sha256
+# hadolint-Linux-x86_64
+# hadolint-Linux-x86_64.sha256
+# hadolint-Windows-x86_64.exe
+# hadolint-Windows-x86_64.exe.sha256
+# Source code (zip)
+# Source code (tar.gz)
diff --git a/makefiles/lint/docker/hadolint.mk b/makefiles/lint/docker/hadolint.mk
new file mode 100644
index 0000000..eb182f7
--- /dev/null
+++ b/makefiles/lint/docker/hadolint.mk
@@ -0,0 +1,80 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+HADOLINT = $(docker-run-app) $(is-stdin) $(vee-citools)-hadolint hadolint
+
+ifdef LOCAL_LINT
+ lint-hadolint-dep = lint-hadolint-local
+else
+ lint-hadolint-dep = lint-hadolint
+endif
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: $(lint-hadolint-dep)
+
+lint : $(lint-hadolint-dep)
+
+lint-dockerfile : $(lint-hadolint-dep)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-hadolint:
+
+ @echo
+ @echo '** -------------------------------------------------------------'
+ @echo "** $(MAKE): processing target [$@]"
+ @echo '** -------------------------------------------------------------'
+ $(HIDE)${HADOLINT} $$(find ./build -name "Dockerfile*")
+ @echo "Dockerfile lint check OK"
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+hadolint-cmd := ./hadolint-Linux-x86_64
+
+lint-hadolint-local: hadolint-get
+ $(hadolint-cmd) $$(find ./build -name "Dockerfile*")
+
+## -----------------------------------------------------------------------
+## Intent: Retrieve the hadolint tool
+## https://github.com/hadolint/hadolint/releases/tag/v2.12.0
+## -----------------------------------------------------------------------
+hadolint-get:
+ true
+# $(MAKECMDGOALS)/lint/docker/get.sh
+# $(GIT) clone https://github.com/hadolint/hadolint.git
+# wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+ @echo ' lint-dockerfile Perform all dockerfile lint checks'
+ @echo ' lint-hadolint Dockerfile lint check'
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+todo ::
+ @echo ' o Update lint-dockerfile to run all dockerfile lint checks'
+
+# [SEE ALSO]
+# https://github.com/hadolint/hadolint
+
+# [EOF]
diff --git a/makefiles/lint/docker/include.mk b/makefiles/lint/docker/include.mk
new file mode 100644
index 0000000..9d6b4d0
--- /dev/null
+++ b/makefiles/lint/docker/include.mk
@@ -0,0 +1,70 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-hadolint lint-hadolint-all lint-hadolint-modified
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+ifndef NO-LINT-HADOLINT
+ have-rst-files := $(if $(strip $(RST_SOURCE)),true)
+ RST_SOURCE ?= $(error RST_SOURCE= is required)
+
+ lint-hadolint-mode := $(if $(have-hadolint-files),modified,all)
+ lint : lint-hadolint-$(lint-hadolint-mode)
+endif# NO-LINT-HADOLINT
+
+# Consistent targets across lint makefiles
+lint-hadolint-all : lint-hadolint
+lint-hadolint-modified : lint-hadolint
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+include $(MAKEDIR)/lint/hadolint/excl.mk
+
+ifdef lint-hadolint-excl
+ lint-hadolint-excl-args += $(addprefix --ignore-path$(space),$(lint-hadolint-excl))
+endif
+lint-hadolint-excl-args += $(addprefix --ignore-path$(space),$(lint-hadolint-excl-raw))
+
+lint-hadolint-args += --max-line-length 120
+
+lint-hadolint: $(venv-activate-script)
+ @echo
+ @echo '** -----------------------------------------------------------------------'
+ @echo '** hadolint *.rst syntax checking'
+ @echo '** -----------------------------------------------------------------------'
+ $(activate) && hadolint --version
+ @echo
+ $(activate) && hadolint $(lint-hadolint-excl-args) $(lint-hadolint-args) .
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-hadolint Syntax check python using the hadolint command'
+ ifdef VERBOSE
+ @echo ' lint-hadolint-all hadolint checking: exhaustive'
+ @echo ' lint-hadolint-modified hadolint checking: only modified'
+ endif
+
+# include $(MAKEDIR)/lint/docker/hadolint.mk
+
+# [EOF]
diff --git a/makefiles/lint/hadolint/excl.mk b/makefiles/lint/hadolint/excl.mk
new file mode 100644
index 0000000..cc4b4af
--- /dev/null
+++ b/makefiles/lint/hadolint/excl.mk
@@ -0,0 +1,17 @@
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+# [EOF]
diff --git a/makefiles/lint/license/include.mk b/makefiles/lint/license/include.mk
index c3569f3..431e45e 100644
--- a/makefiles/lint/license/include.mk
+++ b/makefiles/lint/license/include.mk
@@ -15,21 +15,27 @@
# limitations under the License.
# -----------------------------------------------------------------------
-ifndef mk-include--onf-lint-license# # one-time loader
-ifndef NO-LINT-LICENSE
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
-$(if $(DEBUG),$(warning ENTER))
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-REUSE
+ lint : lint-license
+endif
-$(if $(USE_LINT_LICENSE)\
- ,$(eval include $(ONF_MAKEDIR)/lint/license/voltha-system-tests/include.mk)\
- ,$(eval include $(ONF_MAKEDIR)/lint/license/common.mk)\
-)
+## -----------------------------------------------------------------------
+## Intent: Perform a lint check on makefile sources
+## -----------------------------------------------------------------------
+lint-license:
+ reuse --root . lint
- mk-include--onf-lint-license := true
-
-$(if $(DEBUG),$(warning LEAVE))
-
-endif # NO-LINT-LICENSE
-endif # mk-include--onf-lint-license
+## -----------------------------------------------------------------------
+## Intent: Display command help
+## -----------------------------------------------------------------------
+help-summary ::
+ @echo ' lint-reuse License syntax checking'
# [EOF]
diff --git a/makefiles/lint/license/license-check.sh b/makefiles/lint/license/license-check.sh
index 73f72db..04978cf 100755
--- a/makefiles/lint/license/license-check.sh
+++ b/makefiles/lint/license/license-check.sh
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
-
# -----------------------------------------------------------------------
# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
#
@@ -156,10 +155,12 @@
! -path "*/docs/*" \
! -name 'output.xml' \
! -path "*/vst_venv/*" \
+ ! -path '*/\.venv/*' \
! -name '*#*' \
! -path '*scripts/flog/*' \
! -name '*~' \
! -name 'VERSION' \
+ ! -name 'kail' \
! -name 'patch' \
-print0 )
diff --git a/makefiles/lint/license/voltha-system-tests/include.mk b/makefiles/lint/license/voltha-system-tests/include.mk
index ebbeb90..55ffedb 100644
--- a/makefiles/lint/license/voltha-system-tests/include.mk
+++ b/makefiles/lint/license/voltha-system-tests/include.mk
@@ -15,11 +15,19 @@
# limitations under the License.
# -----------------------------------------------------------------------
+<<<<<<< HEAD
.PHONY: lint-license-vst
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
lint : lint-license-vst
+=======
+.PHONY: lint-license
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint : lint-license
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
lint-license-gargs += --recursive
@@ -38,7 +46,11 @@
# TODO: Normalize into .venv for consistent filtering across projects.
lint-license-gargs += --exclude-dir='.git'
+<<<<<<< HEAD
lint-license-gargs += --exclude-dir='vst_venv'
+=======
+lint-license-gargs += --exclude-dir='$(venv-name)'
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
lint-license-gargs += --exclude-dir='flog'
lint-license-gargs += --exclude='*.json'
@@ -68,7 +80,11 @@
## -----------------------------------------------------------------------
## Jenkins job checking logic.
## -----------------------------------------------------------------------
+<<<<<<< HEAD
lint-license-vst:
+=======
+lint-license:
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
$(MAKEDIR)/lint/license/license-check.sh
## -----------------------------------------------------------------------
diff --git a/makefiles/lint/license/voltha-system-tests/license-check.sh b/makefiles/lint/license/voltha-system-tests/license-check.sh
index 7a9deb9..99fc07f 100755
--- a/makefiles/lint/license/voltha-system-tests/license-check.sh
+++ b/makefiles/lint/license/voltha-system-tests/license-check.sh
@@ -37,9 +37,12 @@
## the only question mark.
## ---------------------------------------------------------------------------
+<<<<<<< HEAD
echo "BLAH"
exit 1
+=======
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
set +e -u -o pipefail
fail_licensecheck=0
@@ -54,17 +57,24 @@
while IFS= read -r -d '' path
do
+<<<<<<< HEAD
case "$path" in
*venv*) echo "GERR: $path"
exit 1
;;
esac
+=======
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
if ! grep -q "${gargs[@]}" "${path}";
then
echo "ERROR: $path does not contain License Header"
fail_licensecheck=1
fi
+<<<<<<< HEAD
done < <(find . \( -name ".git" -o -name '.venv' -o 'vst_venv' \) -prune -o -type f \
+=======
+done < <(find . -name ".git" -prune -o -type f \
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
! -iname "*.png" \
! -name "*.asc" \
! -name "*.bat" \
@@ -155,8 +165,13 @@
! -name "*.pb.h" \
! -name "*.pb.cc" \
! -path "*/docs/*" \
+<<<<<<< HEAD
! -name 'output.xml' \
! -path "*/vst_venv/*" \
+=======
+ ! -name 'output.xml' \
+ ! -path "*/.venv/*" \
+>>>>>>> dc6caae ([VOL-5064] - Build and deploy voltha-system-tests)
! -name '*#*' \
! -path '*scripts/flog/*' \
! -name '*~' \
diff --git a/makefiles/lint/markdown/include.mk b/makefiles/lint/markdown/include.mk
new file mode 100644
index 0000000..26ebf43
--- /dev/null
+++ b/makefiles/lint/markdown/include.mk
@@ -0,0 +1,62 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2022 Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-mdl lint-mdl-all lint-mdl-modified
+
+have-rst-files := $(if $(strip $(RST_SOURCE)),true)
+RST_SOURCE ?= $(error RST_SOURCE= is required)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+ifndef NO-LINT-MARKDOWN
+ lint-mdl-mode := $(if $(have-mdl-files),modified,all)
+ lint : lint-mdl-$(lint-mdl-mode)
+endif# NO-LINT-MDL
+
+# Consistent targets across lint makefiles
+lint-mdl-all : lint-mdl
+lint-mdl-modified : lint-mdl
+
+# onf-excl-dirs
+LINT_STYLE ?= mdl_strict.rb
+
+mdl-excludes := $(foreach path,$(onf-exclude-dirs),! -path "./$(path)/*")
+
+lint-mdl:
+ $(call banner-enter,Target $@)
+ @echo "markdownlint(mdl) version: `mdl --version`"
+ @echo "style config:"
+ @echo "---"
+ @cat $(LINT_STYLE)
+ @echo "---"
+# mdl -s $(LINT_STYLE) `find -L $(SOURCEDIR) ! -path "./_$(venv-activate-script)/*" ! -path "./_build/*" ! -path "./repos/*" ! -path "*vendor*" -name "*.md"`
+ mdl -s $(LINT_STYLE) `find -L $(SOURCEDIR) $(mdl-excludes) -iname "*.md"`
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-mdl Syntax check python using the mdl command'
+ ifdef VERBOSE
+ @echo ' lint-mdl-all mdl checking: exhaustive'
+ @echo ' lint-mdl-modified mdl checking: only modified'
+ endif
+
+# [EOF]
diff --git a/makefiles/lint/markdown/urls b/makefiles/lint/markdown/urls
new file mode 100644
index 0000000..86ff76b
--- /dev/null
+++ b/makefiles/lint/markdown/urls
@@ -0,0 +1,6 @@
+# -*- makefile -*-
+
+# Consumer: repo:voltha-docs
+https://github.com/markdownlint/markdownlint
+
+# [EOF]
diff --git a/makefiles/lint/python/find_utils.mk b/makefiles/lint/python/find_utils.mk
new file mode 100644
index 0000000..7ab4c4f
--- /dev/null
+++ b/makefiles/lint/python/find_utils.mk
@@ -0,0 +1,32 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Intent:
+# o Construct a find command able to gather python files with filtering.
+# o Used by library makefiles flake8.mk and pylint.mk for iteration.
+# -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent: Construct a string for invoking find \( excl-pattern \) -prune
+# -----------------------------------------------------------------------
+gen-python-find-excl = \
+ $(strip \
+ -name '__ignored__' \
+ $(foreach dir,$($(1)),-o -name $(dir)) \
+ )
+
+## -----------------------------------------------------------------------
+## Intent: Construct a find command to gather a list of python files
+## with exclusions.
+## -----------------------------------------------------------------------
+## Usage:
+# $(activate) & $(call gen-python-find-cmd) | $(args-n1) pylint
+## -----------------------------------------------------------------------
+gen-python-find-cmd = \
+ $(strip \
+ find . \
+ \( $(call gen-python-find-excl,onf-excl-dirs) \) -prune \
+ -o -name '*.py' \
+ -print0 \
+ )
+
+# [EOF]
diff --git a/makefiles/lint/python/flake8 b/makefiles/lint/python/flake8
index 4283c3c..763b942 100644
--- a/makefiles/lint/python/flake8
+++ b/makefiles/lint/python/flake8
@@ -21,9 +21,8 @@
lint : lint-python
-lint-python: vst_venv
- -source ./$</bin/activate \
- && set -u \
+lint-python: $(venv-activate-script)
+ -$(activate) \
&& pylint $(PYTHON_FILES) \
&& flake8 --max-line-length=99 --count $(PYTHON_FILE)S
diff --git a/makefiles/lint/python/flake8.mk b/makefiles/lint/python/flake8.mk
index 7a36aaf..6b2b561 100644
--- a/makefiles/lint/python/flake8.mk
+++ b/makefiles/lint/python/flake8.mk
@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------
# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
#
-# Licensed under the Apache License, Version 2.0 (the "License");
+# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -15,35 +15,80 @@
# limitations under the License.
# -----------------------------------------------------------------------
+$(if $(DEBUG),$(warning ENTER))
+
##-------------------##
##---] GLOBALS [---##
##-------------------##
+.PHONY: lint-flake8 lint-flake8-all lint-flake8-modified
-# Gather sources to check
-# TODO: implement deps, only check modified files
-python-check-find := find . -name '*venv*' -prune\
- -o \( -name '*.py' \)\
- -type f -print0
-
-##-------------------##
-##---] TARGETS [---##
-##-------------------##
-ifndef NO-LINT-PYTHON-FLAKE8
- lint : lint-python-flake8
- lint-python : lint-python-flake8
-endif
+PYTHON_FILES ?= $(error PYTHON_FILES= required)
## -----------------------------------------------------------------------
-## Intent: Perform a lint check on makefile sources
+## Intent: Use the flake8 command to perform syntax checking.
+## Usage:
+## % make lint
+## % make lint-flake8-all
## -----------------------------------------------------------------------
-lint-python-flake8:
- $(HIDE)$(env-clean) $(python-check-find) \
+ifndef NO-LINT-FLAKE8
+ lint-flake8-mode := $(if $(have-python-files),modified,all)
+ lint : lint-flake8
+ lint-flake8 : lint-flake8-$(lint-flake8-mode)
+endif# NO-LINT-FLAKE8
+
+## -----------------------------------------------------------------------
+## Intent: exhaustive flake8 syntax checking
+## -----------------------------------------------------------------------
+# Construct: find . \( -name '__ignored__' -o -name dir -o name dir \)
+# flake8-find-filter := $(null)
+# flake8-find-filter += -name '__ignored__'# # for alignment
+# flake8-find-filter += $(foreach dir,$(onf-excl-dirs),-o -name $(dir)))
+
+lint-flake8-all: $(venv-activate-script)
+ $(HIDE)$(MAKE) --no-print-directory lint-flake8-install
+
+ $(activate) && $(call gen-python-find-cmd) \
| $(xargs-n1) flake8 --max-line-length=99 --count
+# && find . \( $(flake8-find-filter) \) -prune -o -name '*.py' -print0 \
+# | $(xargs-n1) flake8 --max-line-length=99 --count
+
## -----------------------------------------------------------------------
-## Intent: Display command help
+## Intent: check deps for format and python3 cleanliness
+## Note:
+## pylint --py3k option no longer supported
## -----------------------------------------------------------------------
-help-summary ::
- @echo ' lint-python-flake8 Syntax check python sources (*.py)'
+lint-flake8-modified: $(venv-activate-script)
+ $(HIDE)$(MAKE) --no-print-directory lint-flake8-install
+
+ $(activate)\
+ && flake8 --max-line-length=99 --count $(PYTHON_FILES)
+
+## -----------------------------------------------------------------------
+## Intent:
+## -----------------------------------------------------------------------
+.PHONY: lint-flake8-install
+lint-flake8-install: $(venv-activate-script)
+ @echo
+ @echo "** -----------------------------------------------------------------------"
+ @echo "** python flake8 syntax checking"
+ @echo "** -----------------------------------------------------------------------"
+ $(activate) && pip install --upgrade flake8
+ $(activate) && flake8 --version
+ @echo
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-flake8 Syntax check python using the flake8 command'
+ ifdef VERBOSE
+ @echo ' $(MAKE) lint-pylint PYTHON_FILES=...'
+ @echo ' lint-flake8-modified flake8 checking: only modified'
+ @echo ' lint-flake8-all flake8 checking: exhaustive'
+ @echo ' lint-flake8-install Install the flake8 command'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
# [EOF]
diff --git a/makefiles/lint/python/include.mk b/makefiles/lint/python/include.mk
index b052d84..57dfd8b 100644
--- a/makefiles/lint/python/include.mk
+++ b/makefiles/lint/python/include.mk
@@ -15,31 +15,17 @@
# limitations under the License.
# -----------------------------------------------------------------------
-ifndef mk-include--onf-lint-python# # one-time loader
-
$(if $(DEBUG),$(warning ENTER))
-## -----------------------------------------------------------------------
-## Intent: Display early so lint targets are grouped
-## -----------------------------------------------------------------------
-help ::
-# @echo
-# @echo '[PYTHON]'
- @echo ' lint-python Syntax check python sources (*.py)'
-# @echo ' help-lint-python-flake8'
-# @echo ' help-lint-python-pylint'
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+$(if $(UNSTABLE),$(eval lint-python-all := true))
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
- ifndef NO-LINT-PYTHON
- include $(ONF_MAKEDIR)/lint/python/flake8.mk
- include $(ONF_MAKEDIR)/lint/python/pylint.mk
- endif
-
- mk-include--onf-lint-python := true
+include $(ONF_MAKEDIR)/lint/python/find_utils.mk
+include $(ONF_MAKEDIR)/lint/python/flake8.mk
+include $(ONF_MAKEDIR)/lint/python/pylint.mk
$(if $(DEBUG),$(warning LEAVE))
-endif # mk-include--onf-lint-license
-
# [EOF]
diff --git a/makefiles/lint/python/pylint.mk b/makefiles/lint/python/pylint.mk
index 028f5dc..cf7e173 100644
--- a/makefiles/lint/python/pylint.mk
+++ b/makefiles/lint/python/pylint.mk
@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------
# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
#
-# Licensed under the Apache License, Version 2.0 (the "License");
+# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -15,40 +15,81 @@
# limitations under the License.
# -----------------------------------------------------------------------
+$(if $(DEBUG),$(warning ENTER))
+
##-------------------##
##---] GLOBALS [---##
##-------------------##
+.PHONY: lint-pylint lint-pylint-all lint-pylint-modified
-# Gather sources to check
-# TODO: implement deps, only check modified files
-python-check-find := find . -name '*venv*' -prune\
- -o \( -name '*.py' \)\
- -type f -print0
-
-# python-check := $(env-clean) pylint
-python-check := pylint
-
-# python-check-args += --dry-run
-
-##-------------------##
-##---] TARGETS [---##
-##-------------------##
-ifndef NO-LINT-PYTHON
- lint : lint-python-pylint
- lint-python : lint-python-pylint
-endif
+PYTHON_FILES ?= $(error PYTHON_FILES= required)
## -----------------------------------------------------------------------
-## Intent: Perform a lint check on makefile sources
+## Intent: Use the pylint command to perform syntax checking.
+## o If UNSTABLE=1 syntax check all sources
+## o else only check sources modified by the developer.
+## Usage:
+## % make lint UNSTABLE=1
+## % make lint-pylint-all
## -----------------------------------------------------------------------
-lint-python-pylint:
- $(HIDE)$(env-clean) $(python-check-find) \
- | $(xargs-n1) $(python-check) $(python-check-args)
+ifndef NO-LINT-PYLINT
+ lint-pylint-mode := $(if $(have-python-files),modified,all)
+ lint : lint-pylint
+ lint-pylint : lint-pylint-$(lint-pylint-mode)
+endif# NO-LINT-PYLINT
## -----------------------------------------------------------------------
-## Intent: Display command help
+## Intent: exhaustive pylint syntax checking
## -----------------------------------------------------------------------
-help-summary ::
- @echo ' lint-python-pylint Syntax check python sources (*.py)'
+
+# Construct: find . \( -name '__ignored__' -o -name dir -o name dir \)
+# pylint-find-filter := $(null)
+# pylint-find-filter += -name '__ignored__'# # for alignment
+# pylint-find-filter += $(foreach dir,$(onf-excl-dirs),-o -name $(dir)))
+
+# pylint-find-filter := $(call gen-python-find-excl,onf-excl-dirs)
+# $(error pylint-find-filter := $(pylint-find-filter))
+lint-pylint-all: $(venv-activate-script)
+ $(MAKE) --no-print-directory lint-pylint-install
+
+ $(activate) && $(call gen-python-find-cmd) | $(xargs-n1) pylint
+# | $(xargs-n1-clean) yamllint --strict
+
+## -----------------------------------------------------------------------
+## Intent: check deps for format and python3 cleanliness
+## Note:
+## pylint --py3k option no longer supported
+## -----------------------------------------------------------------------
+lint-pylint-modified: $(venv-activate-script)
+ $(MAKE) --no-print-directory lint-pylint-install
+
+ $(activate) && pylint $(PYTHON_FILES)
+
+## -----------------------------------------------------------------------
+## Intent:
+## -----------------------------------------------------------------------
+.PHONY: lint-pylint-install
+lint-pylint-install: $(venv-activate-script)
+ @echo
+ @echo "** -----------------------------------------------------------------------"
+ @echo "** python pylint syntax checking"
+ @echo "** -----------------------------------------------------------------------"
+ $(activate) && pip install --upgrade pylint
+ $(activate) && pylint --version
+ @echo
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-pylint Syntax check python using the pylint command'
+ ifdef VERBOSE
+ @echo ' $(MAKE) lint-pylint PYTHON_FILES=...'
+ @echo ' lint-pylint-modified pylint checking: only modified'
+ @echo ' lint-pylint-all pylint checking: exhaustive'
+ @echo ' lint-pylint-install Install the pylint command'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
# [EOF]
diff --git a/makefiles/lint/robot/include.mk b/makefiles/lint/robot/include.mk
new file mode 100644
index 0000000..283c729
--- /dev/null
+++ b/makefiles/lint/robot/include.mk
@@ -0,0 +1,65 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2022 Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-robot lint-robot-all lint-robot-modified
+
+have-robot-files := $(if $(strip $(ROBOT_FILES)),true)
+ROBOT_FILES ?= $(error ROBOT_FILES= is required)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+ifndef NO-LINT-ROBOT
+ lint-robot-mode := $(if $(have-robot-files),modified,all)
+ lint : lint-robot-$(lint-robot-mode)
+endif# NO-LINT-ROBOT
+
+# Consistent targets across lint makefiles
+lint-robot-all : lint-robot
+lint-robot-modified : lint-robot
+
+LINT_ARGS ?= --verbose --configure LineTooLong:130 -e LineTooLong \
+ --configure TooManyTestSteps:65 -e TooManyTestSteps \
+ --configure TooManyTestCases:50 -e TooManyTestCases \
+ --configure TooFewTestSteps:1 \
+ --configure TooFewKeywordSteps:1 \
+ --configure FileTooLong:2000 -e FileTooLong \
+ -e TrailingWhitespace
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-robot: $(venv-activate-script)
+ @echo
+ @echo '** -----------------------------------------------------------------------'
+ @echo '** robot *.rst syntax checking'
+ @echo '** -----------------------------------------------------------------------'
+# $(activate) && rflint --version
+ $(activate) && rflint $(LINT_ARGS) $(ROBOT_FILES)
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-robot Syntax check python using the robot command'
+ ifdef VERBOSE
+ @echo ' lint-robot-all robot checking: exhaustive'
+ @echo ' lint-robot-modified robot checking: only modified'
+ endif
+
+# [EOF]
diff --git a/makefiles/lint/shell.mk b/makefiles/lint/shell.mk
new file mode 100644
index 0000000..3c33bb2
--- /dev/null
+++ b/makefiles/lint/shell.mk
@@ -0,0 +1,65 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+# Gather sources to check
+# TODO: implement deps, only check modified files
+shell-check-find := find .
+# vendor scripts but they really should be lintable
+shell-check-find += -name 'vendor' -prune
+shell-check-find += -o \( -name '*.sh' \)
+shell-check-find += -type f -print0
+
+shell-check := $(env-clean) shellcheck
+# shell-check := shellcheck
+
+shell-check-args += --check-sourced
+shell-check-args += --external-sources
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+ifndef NO-LINT-SHELL
+ lint : lint-shell
+endif
+
+## -----------------------------------------------------------------------
+## Intent: Perform a lint check on command line script sources
+## -----------------------------------------------------------------------
+lint-shell:
+ $(shell-check) -V
+ @echo
+ $(HIDE)$(env-clean) $(shell-check-find) \
+ | $(xargs-n1) $(shell-check) $(shell-check-args)
+
+## -----------------------------------------------------------------------
+## Intent: Display command help
+## -----------------------------------------------------------------------
+help-summary ::
+ @echo ' lint-shell Syntax check shell sources'
+
+# [SEE ALSO]
+# -----------------------------------------------------------------------
+# o https://www.shellcheck.net/wiki/Directive
+
+# [EOF]
diff --git a/makefiles/lint/shellcheck/urls b/makefiles/lint/shellcheck/urls
new file mode 100644
index 0000000..a35dbab
--- /dev/null
+++ b/makefiles/lint/shellcheck/urls
@@ -0,0 +1,5 @@
+# -*- makefile -*-
+
+https://github.com/koalaman/shellcheck/releases/tag/v0.9.0
+
+# [EOF]
\ No newline at end of file
diff --git a/makefiles/lint/yaml./.yamllint b/makefiles/lint/yaml./.yamllint
new file mode 100644
index 0000000..c42c6d5
--- /dev/null
+++ b/makefiles/lint/yaml./.yamllint
@@ -0,0 +1,45 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+---
+
+yaml-files:
+ - '*.yaml'
+ - '*.yml'
+ - '.yamllint'
+
+rules:
+ document-start: disable
+ line-length:
+ max: 160
+
+# -----------------------------------------------------------------------
+# .. seealso: https://gerrit.opencord.org/plugins/gitiles/helm-repo-tools/+/refs/heads/master/yamllint.conf
+# -----------------------------------------------------------------------
+#
+# extends: default
+#
+#rules:
+# empty-lines:
+# max-end: 1
+# line-length:
+# max: 120
+# braces:
+# min-spaces-inside: 0
+# max-spaces-inside: 1
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/include.mk b/makefiles/lint/yaml./byrepo/voltha-lib-go/include.mk
new file mode 100644
index 0000000..6cbd0ea
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/include.mk
@@ -0,0 +1,27 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(ONF_MAKEDIR)/lint/yaml/byrepo/$(--repo-name--)/yamllint.mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/python.mk b/makefiles/lint/yaml./byrepo/voltha-lib-go/python.mk
new file mode 100644
index 0000000..cf0eef5
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/python.mk
@@ -0,0 +1,41 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+YAML_FILES ?= $(error YAML_FILES= is required)
+
+lint-yaml-dep = $(addsuffix ^lint-yaml,$(YAML_FILES))
+lint-yaml-src = $(firstword $(subst ^,$(space),$(1)))
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+.PHONY : lint-yaml
+lint : lint-yaml
+
+lint-yaml: $(venv-activate)
+lint-yaml: $(lint-yaml-dep)
+
+$(lint-yaml-dep):
+ $(vst-env) && yamllint -s $(call lint-yaml-src,$@)
+
+help::
+ @echo " lint-yaml Syntax check yaml sources"
+
+# [EOF]
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/repo b/makefiles/lint/yaml./byrepo/voltha-lib-go/repo
new file mode 100644
index 0000000..99e8451
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/repo
@@ -0,0 +1 @@
+Source from voltha-lib-go
\ No newline at end of file
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/todo b/makefiles/lint/yaml./byrepo/voltha-lib-go/todo
new file mode 100644
index 0000000..8400c64
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/todo
@@ -0,0 +1,39 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+env-clean = /usr/bin/env --ignore-environment
+xargs-n1 := xargs -0 -t -n1 --no-run-if-empty
+
+yamllint := $(env-clean) $(YAMLLINT)
+yamllint-args := -c .yamllint
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+lint : lint-yaml
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-yaml:
+ $(HIDE)$(env-clean) find . -name '*.yaml' -type f -print0 \
+ | $(xargs-n1) $(yamllint) $(yamllint-args)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help:
+ @echo
+ @echo "USAGE: $(MAKE)"
+ @echo " lint perform syntax checks on source"
+ @echo " test perform syntax checks on source"
+ @echo " pre-check Verify tools and deps are available for testing"
+ @echo
+ @echo "[LINT]"
+ @echo " lint-json Syntax check .json sources"
+ @echo " lint-yaml Syntax check .yaml sources"
+ @echo
+# [EOF]
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/urls b/makefiles/lint/yaml./byrepo/voltha-lib-go/urls
new file mode 100644
index 0000000..8747658
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/urls
@@ -0,0 +1,5 @@
+# -*- makefile -*-
+
+https://yamllint.readthedocs.io/en/stable/configuration.html
+
+# [EOF]
\ No newline at end of file
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.helm b/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.helm
new file mode 100644
index 0000000..bf1d2b9
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.helm
@@ -0,0 +1,32 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+---
+# yamllint.conf
+
+extends: default
+
+rules:
+ empty-lines:
+ max-end: 1
+ line-length:
+ max: 120
+ braces:
+ min-spaces-inside: 0
+ max-spaces-inside: 1
diff --git a/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.mk b/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.mk
new file mode 100644
index 0000000..fb56e3a
--- /dev/null
+++ b/makefiles/lint/yaml./byrepo/voltha-lib-go/yamllint.mk
@@ -0,0 +1,72 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+--onf-mk-lint-yaml-- := true# # Inhibit loading downstream lint-yaml targets
+
+# yamllint := $(env-clean) yamllint
+# yamllint := $(activate) && yamllint
+
+YAMLLINT = $(activate) && yamllint
+
+## -------------------------------
+## Add requirement(s) for checking
+## -------------------------------
+yamllint-cfg := yamllint.helm
+yamllint-conf = $(wildcard $(yamllint-cfg) $(ONF_MAKEDIR)/lint/yaml/$(yamllint-cfg))
+yamllint-args += $(addprefix --config-file$(space),$(yamllint-conf))
+yamllint-args += --strict
+
+## -----------------------------------------------------------------------
+## Intent: Use the yaml command to perform syntax checking.
+## -----------------------------------------------------------------------
+ifndef NO-LINT-YAML
+ # lint-yaml-mode := $(if $(have-yaml-files),modified,all)
+ lint : lint-yaml
+ lint-yaml : lint-yaml-votlha-lib-go
+# lint-yaml : lint-yaml-all-votlha-lib-go-$(lint-yaml-mode)
+endif# NO-LINT-YAML
+
+## -----------------------------------------------------------------------
+## ----------------------------------------------------------------------
+lint-yaml-votlha-lib-go: lint-yaml-cmd-version
+
+ $(call banner-enter,Target $@)
+ $(HIDE)$(MAKE) --no-print-directory lint-yaml-install
+
+ $(HIDE)$(env-clean) $(call gen-yaml-find-cmd) \
+ | $(env-clean) $(xargs-cmd) -I'{}' \
+ bash -c "$(YAMLLINT) $(yamllint-args) {}"
+ $(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ # lint-yaml help already displayed by lint/yaml/help.mk
+ ifdef VERBOSE
+ @echo ' $(MAKE) lint-yaml YAML_FILES=...'
+ @echo ' lint-yaml-votlha-lib-go lint-yaml for repo:voltha-lib-go'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/yaml./find_utils.mk b/makefiles/lint/yaml./find_utils.mk
new file mode 100644
index 0000000..49d4cb0
--- /dev/null
+++ b/makefiles/lint/yaml./find_utils.mk
@@ -0,0 +1,32 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Intent:
+# o Construct a find command able to gather python files with filtering.
+# o Used by library makefiles flake8.mk and pylint.mk for iteration.
+# -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## Intent: Construct a string for invoking find \( excl-pattern \) -prune
+# -----------------------------------------------------------------------
+gen-yaml-find-excl = \
+ $(strip \
+ -name '__ignored__' \
+ $(foreach dir,$($(1)),-o -name $(dir)) \
+ )
+
+## -----------------------------------------------------------------------
+## Intent: Construct a find command to gather a list of python files
+## with exclusions.
+## -----------------------------------------------------------------------
+## Usage:
+# $(activate) & $(call gen-python-find-cmd) | $(args-n1) pylint
+## -----------------------------------------------------------------------
+gen-yaml-find-cmd = \
+ $(strip \
+ find . \
+ \( $(call gen-yaml-find-excl,onf-excl-dirs) \) -prune \
+ -o \( -iname '*.yaml' -o -iname '*.yml' \) \
+ -print0 \
+ )
+
+# [EOF]
diff --git a/makefiles/lint/yaml./help.mk b/makefiles/lint/yaml./help.mk
new file mode 100644
index 0000000..ef8621e
--- /dev/null
+++ b/makefiles/lint/yaml./help.mk
@@ -0,0 +1,41 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## ---------------------------------------------------------------------------
+## Intent: Display a help banner early so includes below that also define
+## help targets will be displayed beneath a high level banner.
+## ---------------------------------------------------------------------------
+help ::
+ ifndef VERBOSE
+ @echo ' lint-yaml Invoke all yaml linting targets'
+ else
+ $(HIDE)$(MAKE) --no-print-directory help-lint-yaml
+ endif
+
+## ---------------------------------------------------------------------------
+## Intent: Display extended target help
+## ---------------------------------------------------------------------------
+help-lint-yaml:
+ @echo
+ @echo '[LINT: yaml] (make lint-yaml VERBOSE=1)'
+ @echo ' lint-yaml Invoke all yaml linting targets'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/yaml./include.mk b/makefiles/lint/yaml./include.mk
new file mode 100644
index 0000000..26c4a7f
--- /dev/null
+++ b/makefiles/lint/yaml./include.mk
@@ -0,0 +1,42 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+ifndef --onf-mk-lint-yaml--
+
+$(if $(DEBUG),$(warning ENTER))
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(ONF_MAKEDIR)/lint/yaml/help.mk
+include $(ONF_MAKEDIR)/lint/yaml/find_utils.mk
+include $(ONF_MAKEDIR)/lint/yaml/install.mk
+
+# [TODO] Consolidate and refactor to support a simpler answer
+# Special snowflake linting requirements
+-include $(ONF_MAKEDIR)/lint/yaml/byrepo/$(--repo-name--)/include.mk
+
+# Standard lint-yaml targets
+include $(ONF_MAKEDIR)/lint/yaml/yamllint.mk
+
+--onf-mk-lint-yaml-- := true# # Flag to inhibit re-including
+
+$(if $(DEBUG),$(warning LEAVE))
+
+endif # --onf-mk-lint-yaml--
+
+# [EOF]
diff --git a/makefiles/lint/yaml./install.mk b/makefiles/lint/yaml./install.mk
new file mode 100644
index 0000000..a17c3b7
--- /dev/null
+++ b/makefiles/lint/yaml./install.mk
@@ -0,0 +1,69 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Install the yamllint tool
+## -----------------------------------------------------------------------
+.PHONY: lint-yaml-install
+
+# -----------------------------------------------------------------------
+# We can(/should?) define a command macro
+# wait a bit until use cases are better known.
+# Initial use required inserting xargs bash -c "$(YAMLLINT) {}"
+# -----------------------------------------------------------------------
+# YAMLLINT ?= $(venv-activate-bin)/yamllint
+# YAMLLINT ?= $(activate) && yamllint
+
+## -----------------------------------------------------------------------
+## Intent: Display yamllint command version string.
+## Note: As a side effect, install yamllint by dependency
+## -----------------------------------------------------------------------
+.PHONY: lint-yaml-cmd-version
+lint-yaml-cmd-version : $(venv-activate-bin)/yamllint
+
+ $(HIDE) echo
+ $< --version
+
+## -----------------------------------------------------------------------
+## Intent: On-demand instalation of the yamllint command
+## -----------------------------------------------------------------------
+lint-yaml-install := $(venv-activate-bin)/yamllint
+$(lint-yaml-install) : $(venv-activate-script)
+
+ $(call banner-enter,Target $@)
+ $(activate) && pip install yamllint
+ $(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: Purge yamllint tool installation
+## -----------------------------------------------------------------------
+sterile ::
+ $(HIDE)$(RM) "$(venv-abs-bin)/yamllint"
+ $(HIDE)$(RM) -r .venv/lib/*/site-packages/yamllint
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-yaml-install Install the yamllint tool'
+
+# [EOF]
diff --git a/makefiles/lint/yaml./yamllint.mk b/makefiles/lint/yaml./yamllint.mk
new file mode 100644
index 0000000..1563c7c
--- /dev/null
+++ b/makefiles/lint/yaml./yamllint.mk
@@ -0,0 +1,78 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License")
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-yaml lint-yaml-all lint-yaml-modified
+
+have-yaml-files := $(if $(strip $(YAML_FILES)),true)
+YAML_FILES ?= $(error YAML_FILES= is required)
+
+YAMLLINT = $(activate) && yamllint
+yamllint-args += --strict
+
+## -----------------------------------------------------------------------
+## Intent: Use the yaml command to perform syntax checking.
+## -----------------------------------------------------------------------
+ifndef NO-LINT-YAML
+ lint-yaml-mode := $(if $(have-yaml-files),modified,all)
+ lint : lint-yaml
+ lint-yaml : lint-yaml-$(lint-yaml-mode)
+endif# NO-LINT-YAML
+
+## -----------------------------------------------------------------------
+## Intent: exhaustive yaml syntax checking
+## -----------------------------------------------------------------------
+lint-yaml-all: lint-yaml-cmd-version
+
+ $(call banner-enter,Target $@)
+ $(HIDE)$(MAKE) --no-print-directory lint-yaml-install
+ $(HIDE)$(activate) && $(call gen-yaml-find-cmd) \
+ | $(env-clean) $(xargs-cmd) -I'{}' \
+ bash -c "$(YAMLLINT) $(yamllint-args) {}"
+ $(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: check deps for format and python3 cleanliness
+## Note:
+## yaml --py3k option no longer supported
+## -----------------------------------------------------------------------
+lint-yaml-modified: lint-yaml-cmd-version
+
+ $(call banner-enter,Target $@)
+ $(HIDE)$(MAKE) --no-print-directory lint-yaml-install
+ $(YAMLLINT) $(yamllint-args) $(YAML_FILES)
+ $(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-yaml Syntax check python using the yaml command'
+ ifdef VERBOSE
+ @echo ' $(MAKE) lint-yaml YAML_FILES=...'
+ @echo ' lint-yaml-all yaml checking: exhaustive'
+ @echo ' lint-yaml-modified yaml checking: only locally modified'
+ @echo ' lint-yaml-install Install the pylint command'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/yaml.mk b/makefiles/lint/yaml.mk
new file mode 100644
index 0000000..ab5b9d6
--- /dev/null
+++ b/makefiles/lint/yaml.mk
@@ -0,0 +1,84 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License")
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+.PHONY: lint-yaml lint-yaml-all lint-yaml-modified
+
+have-yaml-files := $(if $(strip $(YAML_FILES)),true)
+YAML_FILES ?= $(error YAML_FILES= is required)
+
+## -----------------------------------------------------------------------
+## Intent: Use the yaml command to perform syntax checking.
+## o If UNSTABLE=1 syntax check all sources
+## o else only check sources modified by the developer.
+## Usage:
+## % make lint UNSTABLE=1
+## % make lint-yaml-all
+## -----------------------------------------------------------------------
+lint-yaml-mode := $(if $(have-yaml-files),modified,all)
+lint-yaml : lint-yaml-$(lint-yaml-mode)
+
+ifndef NO-LINT-YAML
+ lint : lint-yaml# # Enable as a default lint target
+endif# NO-LINT-YAML
+
+## -----------------------------------------------------------------------
+## Intent: exhaustive yaml syntax checking
+## -----------------------------------------------------------------------
+lint-yaml-all:
+ $(HIDE)$(MAKE) --no-print-directory lint-yaml-install
+
+ find . \( -iname '*.yaml' -o -iname '*.yml' \) -print0 \
+ | $(xargs-n1-clean) yamllint --strict
+
+## -----------------------------------------------------------------------
+## Intent: check deps for format and python3 cleanliness
+## Note:
+## yaml --py3k option no longer supported
+## -----------------------------------------------------------------------
+lint-yaml-modified:
+ $(HIDE)$(MAKE) --no-print-directory lint-yaml-install
+ yamllint -s $(YAML_FILES)
+
+## -----------------------------------------------------------------------
+## Intent:
+## -----------------------------------------------------------------------
+lint-yaml-install:
+ @echo
+ @echo "** -----------------------------------------------------------------------"
+ @echo "** yaml syntax checking"
+ @echo "** -----------------------------------------------------------------------"
+ yamllint --version
+ @echo
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+help::
+ @echo ' lint-yaml Syntax check python using the yaml command'
+ ifdef VERBOSE
+ @echo ' lint-yaml-all yaml checking: exhaustive'
+ @echo ' lint-yaml-modified yaml checking: only locally modified'
+ endif
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/yaml/install.mk b/makefiles/lint/yaml/install.mk
index edcc212..19e8628 100644
--- a/makefiles/lint/yaml/install.mk
+++ b/makefiles/lint/yaml/install.mk
@@ -60,6 +60,10 @@
$(HIDE)$(RM) "$(venv-abs-bin)/yamllint"
$(HIDE)$(RM) -r .venv/lib/*/site-packages/yamllint
+ # Remove both file:command and dir:libraries
+ # find "$(venv-abs-path)" -iname 'yamllint' -print0 \
+ # | $(xargs-n1-clean) $(RM) -r {}
+
## -----------------------------------------------------------------------
## Intent: Display command usage
## -----------------------------------------------------------------------