VOL-4836 - Cosmetic edits to trigger a jenkins job
Makefile
makefiles/
o Copy in makefile library for common constants and targets
deployment-configs/
kubernetes-configs/
tosca-configs/att-workflow/
tosca-configs/rcord-topdown/
----------------------------
o Modify copyright notice to initate a jenkins job.
Change-Id: I6303172ba54bfcc3ed7bf766a048b900d902efea
diff --git a/Makefile b/Makefile
index 4feb29b..3f52516 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,26 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+# 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.
+#
+# SPDX-FileCopyrightText: 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+# -*- makefile -*-
+# -----------------------------------------------------------------------
# Copyright 2017-2022 Open Networking Foundation (ONF) and the ONF Contributors
# SPDX-FileCopyrightText: 2022-present Intel Corporation
#
@@ -8,15 +29,10 @@
.DEFAULT_GOAL := test
-HIDE ?= @
-SHELL := bash -e -o pipefail
-
dot ?= .
TOP ?= $(dot)
MAKEDIR ?= $(TOP)/makefiles
-env-clean = /usr/bin/env --ignore-environment
-
jq = $(env-clean) jq
jq-args += --exit-status
@@ -24,6 +40,11 @@
yamllint := $(env-clean) $(YAMLLINT)
yamllint-args := -c .yamllint
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+include $(MAKEDIR)/include.mk
+
##-------------------##
##---] TARGETS [---##
##-------------------##
@@ -82,22 +103,7 @@
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
-todo:
- @echo
- @echo "USAGE: $(MAKE)"
- @echo "[TODO]"
- @echo " o Update to support standard makefile target behavior:"
- @echo " all taget is test not default behavior for automation."
- @echo " o Change lint target dep from test to check -or smoke"
- @echo " target test sould be more involved with content validation"
- @echo " o Refactor lint target(s) with voltha-system-tests/makefiles"
- @echo " o Linting should be dependency driven,"
- @echo " only check when sources are modified."
- @echo
-
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
-help:
+help::
@echo
@echo "USAGE: $(MAKE)"
@echo " lint perform syntax checks on source"
@@ -115,4 +121,5 @@
@echo " pre-commit Perform common repairs on source"
@echo " fixperms Remove group write permission on config files"
@echo
+
# [EOF]
diff --git a/deployment-configs/berlin-community-pod-1-gpon-DT.yaml b/deployment-configs/berlin-community-pod-1-gpon-DT.yaml
index f70e10f..ec51fd5 100644
--- a/deployment-configs/berlin-community-pod-1-gpon-DT.yaml
+++ b/deployment-configs/berlin-community-pod-1-gpon-DT.yaml
@@ -1,6 +1,6 @@
---
- # Copyright 2020-present Open Networking Foundation
+ # Copyright 2020-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.
diff --git a/deployment-configs/berlin-community-pod-1-gpon-adtran-DT.yaml b/deployment-configs/berlin-community-pod-1-gpon-adtran-DT.yaml
index 7503559..11c4551 100644
--- a/deployment-configs/berlin-community-pod-1-gpon-adtran-DT.yaml
+++ b/deployment-configs/berlin-community-pod-1-gpon-adtran-DT.yaml
@@ -1,6 +1,6 @@
---
- # Copyright 2020-present Open Networking Foundation
+ # 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.
diff --git a/deployment-configs/berlin-community-pod-1-gpon-fttb-DT.yaml b/deployment-configs/berlin-community-pod-1-gpon-fttb-DT.yaml
index 417f53d..a838049 100644
--- a/deployment-configs/berlin-community-pod-1-gpon-fttb-DT.yaml
+++ b/deployment-configs/berlin-community-pod-1-gpon-fttb-DT.yaml
@@ -1,6 +1,6 @@
---
- # Copyright 2020-present Open Networking Foundation
+ # 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.
diff --git a/deployment-configs/berlin-community-pod-1-kubespray.yaml b/deployment-configs/berlin-community-pod-1-kubespray.yaml
index 3bb0324..14c749d 100644
--- a/deployment-configs/berlin-community-pod-1-kubespray.yaml
+++ b/deployment-configs/berlin-community-pod-1-kubespray.yaml
@@ -1,6 +1,6 @@
---
-# Copyright 2020-present Open Networking Foundation
+# Copyright 2020-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.
diff --git a/deployment-configs/berlin-community-pod-1.yaml b/deployment-configs/berlin-community-pod-1.yaml
index a6bf918..953c77e 100644
--- a/deployment-configs/berlin-community-pod-1.yaml
+++ b/deployment-configs/berlin-community-pod-1.yaml
@@ -1,6 +1,6 @@
---
-# Copyright 2020-present Open Networking Foundation
+# Copyright 2020-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.
diff --git a/deployment-configs/flex-ocp-cord-multi-uni-TT.yaml b/deployment-configs/flex-ocp-cord-multi-uni-TT.yaml
index 62f5338..0e48c8e 100644
--- a/deployment-configs/flex-ocp-cord-multi-uni-TT.yaml
+++ b/deployment-configs/flex-ocp-cord-multi-uni-TT.yaml
@@ -1,4 +1,4 @@
-# Copyright 2021-present Open Networking Foundation
+# Copyright 2021-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.
diff --git a/deployment-configs/menlo-certification-pod-radisys-gpon.yaml b/deployment-configs/menlo-certification-pod-radisys-gpon.yaml
index 874cd0a..196b484 100644
--- a/deployment-configs/menlo-certification-pod-radisys-gpon.yaml
+++ b/deployment-configs/menlo-certification-pod-radisys-gpon.yaml
@@ -1,6 +1,6 @@
---
- # Copyright 2020-present Open Networking Foundation
+ # Copyright 2020-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.
diff --git a/deployment-configs/onf-soak-pod.yaml b/deployment-configs/onf-soak-pod.yaml
index 1803435..3246139 100644
--- a/deployment-configs/onf-soak-pod.yaml
+++ b/deployment-configs/onf-soak-pod.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/kubernetes-configs/bbsim-voltha-master.yml b/kubernetes-configs/bbsim-voltha-master.yml
index 1abc1b3..58bb622 100644
--- a/kubernetes-configs/bbsim-voltha-master.yml
+++ b/kubernetes-configs/bbsim-voltha-master.yml
@@ -1,5 +1,5 @@
---
-# Copyright 2018-present Open Networking Foundation
+# Copyright 2018-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.
diff --git a/kubernetes-configs/flex-ocp-cord.yml b/kubernetes-configs/flex-ocp-cord.yml
index 68afc7f..3e5b28b 100644
--- a/kubernetes-configs/flex-ocp-cord.yml
+++ b/kubernetes-configs/flex-ocp-cord.yml
@@ -1,5 +1,5 @@
---
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/kubernetes-configs/flex-ocp-mcord.yml b/kubernetes-configs/flex-ocp-mcord.yml
index 7a70a10..6e6316d 100644
--- a/kubernetes-configs/flex-ocp-mcord.yml
+++ b/kubernetes-configs/flex-ocp-mcord.yml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/kubernetes-configs/onf-soak-pod-openonugo.yaml b/kubernetes-configs/onf-soak-pod-openonugo.yaml
index 7a2168c..b7440a9 100644
--- a/kubernetes-configs/onf-soak-pod-openonugo.yaml
+++ b/kubernetes-configs/onf-soak-pod-openonugo.yaml
@@ -1,5 +1,5 @@
---
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/kubernetes-configs/onlab-pod1-voltha16.yml b/kubernetes-configs/onlab-pod1-voltha16.yml
index eb81693..ff2254c 100644
--- a/kubernetes-configs/onlab-pod1-voltha16.yml
+++ b/kubernetes-configs/onlab-pod1-voltha16.yml
@@ -1,5 +1,5 @@
---
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/kubernetes-configs/onlab-pod1.yml b/kubernetes-configs/onlab-pod1.yml
index d8c048e..f628bfb 100644
--- a/kubernetes-configs/onlab-pod1.yml
+++ b/kubernetes-configs/onlab-pod1.yml
@@ -1,5 +1,5 @@
---
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/makefiles/consts.mk b/makefiles/consts.mk
new file mode 100644
index 0000000..c96cb88
--- /dev/null
+++ b/makefiles/consts.mk
@@ -0,0 +1,30 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022 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
+# -----------------------------------------------------------------------
+
+null :=#
+space := $(null) $(null)
+dot ?= .
+
+HIDE ?= @
+SHELL := bash -e -o pipefail
+
+env-clean = /usr/bin/env --ignore-environment
+
+# [EOF]
diff --git a/makefiles/include.mk b/makefiles/include.mk
new file mode 100644
index 0000000..27fb6b6
--- /dev/null
+++ b/makefiles/include.mk
@@ -0,0 +1,37 @@
+# -*- 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.
+#
+# SPDX-FileCopyrightText: 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+MAKEDIR ?= $(error MAKEDIR= is required)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help::
+ @echo "USAGE: $(MAKE) [options] [target] ..."
+ # @echo " test Sanity check chart versions"
+
+include $(MAKEDIR)/consts.mk
+include $(MAKEDIR)/todo.mk
+include $(MAKEDIR)/lint/include.mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/golang/sca.mk b/makefiles/lint/golang/sca.mk
new file mode 100644
index 0000000..eeecc42
--- /dev/null
+++ b/makefiles/lint/golang/sca.mk
@@ -0,0 +1,60 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+GOLANG_FILES ?= $(error PYTHON_FILES= is required)
+
+.PHONY: lint-golang-sca
+
+lint : lint-golang-sca
+
+## -----------------------------------------------------------------------
+## Intent: Run goformat on files on sandbox files.
+## 1) find . -name '*.go' -print0
+## - gather all *.go sources (-name '*.go')
+## - pass as a list of null terminated items (-print0)
+## 2) xargs --null --max-args=[n] --no-run-if-empty gofmt -d
+## - Iterate over the list (xargs --null)
+## - process one item per line (--max-args=1)
+## - display filename-to-check (--verbose)
+## - display content when diffs are detected:
+## gofmt -d
+## gofmt -d -s
+## -----------------------------------------------------------------------
+lint-golang-sca-xargs := $(null)
+lint-golang-sca-xargs += --null#+ # Source paths are null terminated
+lint-golang-sca-xargs += --max-args=1#+ # Check one file at a time
+lint-golang-sca-xargs += --no-run-if-empty
+lint-golang-sca-xargs += --verbose#+ # Display source path to check
+
+## [INPLACE-EDITS] make lint-golang-sca FIX=1
+ifdef FIX
+ lint-golang-sca-args += -w
+endif
+
+lint-golang-sca:
+ find . -name '*.go' -print0 \
+ | xargs $(lint-golang-sca-xargs) gofmt -d -s
+
+help::
+ @echo " lint-golang-sca Syntax check golang sources"
+ @echo " MODIFIER: FIX=1 Correct problems (gofmt -d -s -w)"
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/include.mk b/makefiles/lint/include.mk
new file mode 100644
index 0000000..3466b58
--- /dev/null
+++ b/makefiles/lint/include.mk
@@ -0,0 +1,34 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+help::
+ @echo
+ @echo "[LINT]"
+ @echo " lint Static code analysis/syntax checking"
+ @echo " LOCAL_LINT=1 Enable local linting w/o docker & jenkins overhead"
+
+ifdef LOCAL_LINT
+ # include $(MAKEDIR)/lint/json.mk # venv dependency
+ # include $(MAKEDIR)/lint/golang/sca.mk
+ # include $(MAKEDIR)/lint/license/include.mk # exclusions needed
+ # include $(MAKEDIR)/lint/python.mk
+ # include $(MAKEDIR)/lint/robot.mk # venv dependency
+ # include $(MAKEDIR)/lint/shell.mk # cleanup needed
+ # include $(MAKEDIR)/lint/yaml.mk # venv needed -- alt: yamllint
+endif
+
+# [EOF]
diff --git a/makefiles/lint/json.mk b/makefiles/lint/json.mk
new file mode 100644
index 0000000..cc9ecfa
--- /dev/null
+++ b/makefiles/lint/json.mk
@@ -0,0 +1,35 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+JSON_FILES ?= $(error JSON_FILES= is required)
+
+.PHONY: lint-json
+
+lint : lint-json
+
+lint-json: vst_venv
+ source ./$</bin/activate \
+ ; set -u \
+ ; for jsonfile in $(JSON_FILES); do \
+ echo "Validating json file: $$jsonfile" ;\
+ python -m json.tool $$jsonfile > /dev/null ;\
+ done
+
+help::
+ @echo " lint-json Syntax check json sources"
+
+# [EOF]
diff --git a/makefiles/lint/license/include.mk b/makefiles/lint/license/include.mk
new file mode 100644
index 0000000..aaf6e47
--- /dev/null
+++ b/makefiles/lint/license/include.mk
@@ -0,0 +1,88 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 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.
+# -----------------------------------------------------------------------
+
+# JSON_FILES ?= $(error JSON_FILES= is required)
+
+.PHONY: lint-license
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint : lint-license
+
+lint-license-gargs += --recursive
+
+# ignore: png, xlsx
+# will utf8 be excluded(?)
+lint-license-gargs += --binary-files=without-match
+lint-license-gargs += --files-without-match
+
+# [TODO] license checking accepts either Copy or Apache.
+# [TODO] At least Copyright should be required (both?)
+lint-license-gargs += --extended-regexp
+lint-license-gargs += -e 'Copyright[[:space:]]+[[:digit:]]{4}'
+lint-license-gargs += -e 'Apache License'
+
+# [TODO] --strict, --strict-dates
+
+# Editor temp files
+lint-license-gargs += --exclude='*.~'
+lint-license-gargs += --exclude='*.swp'
+
+lint-license-gargs += --exclude-dir='.git'
+
+# TODO: Normalize into .venv for consistent filtering across projects.
+lint-license-gargs += --exclude-dir='vst_venv'
+lint-license-gargs += --exclude-dir='flog'
+
+lint-license-gargs += --exclude='*.json'
+lint-license-gargs += --exclude='*.md'
+lint-license-gargs += --exclude='*.out'
+lint-license-gargs += --exclude='*.pyc'
+lint-license-gargs += --exclude='*.xml'
+
+# [FILE(s)]
+lint-license-gargs += --exclude='VERSION'
+
+# [GIT]
+# lint-license-gargs += --exclude='.gitignore'
+# lint-license-gargs += --exclude='.gitreview'
+lint-license-gargs += --exclude='\.*'
+
+# [PYTHON]
+lint-license-gargs += --exclude='requirements.txt'
+
+# [WIP]
+lint-license-gargs += --exclude='patch'
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-license-new:
+ grep $(lint-license-gargs) $(dot)
+
+## -----------------------------------------------------------------------
+## Jenkins job checking logic.
+## -----------------------------------------------------------------------
+lint-license:
+ $(MAKEDIR)/lint/license/license-check.sh
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+ @echo " lint-license Verify sources contain a license block."
+ @echo " lint-license-new Grep driven replacement logic."
+
+# [EOF]
diff --git a/makefiles/lint/license/license-check.sh b/makefiles/lint/license/license-check.sh
new file mode 100755
index 0000000..10d3376
--- /dev/null
+++ b/makefiles/lint/license/license-check.sh
@@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+
+# -----------------------------------------------------------------------
+# Copyright 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.
+# -----------------------------------------------------------------------
+
+# licensecheck.sh
+# checks for copyright/license headers on files
+# excludes filename extensions where this check isn't pertinent
+
+# --strict
+# --strict-dates
+# see https://github...
+
+## ---------------------------------------------------------------------------
+## find: warning: ‘-name’ matches against basenames only, but the given pattern
+## contains a directory separator (‘/’), thus the expression will evaluate to
+## false all the time. Did you mean ‘-wholename’?
+##
+## [TODO] find and fix plugin script, change --name to --path:
+## find ! -name "*/docs/*"
+## ---------------------------------------------------------------------------
+## [TODO] see license/include.mk, grep -L will ignore binaries so no need to
+## explicitly filter images, spreadsheets, etc. Files containing utf-8 are
+## the only question mark.
+## ---------------------------------------------------------------------------
+
+set +e -u -o pipefail
+fail_licensecheck=0
+
+declare -a gargs=()
+gargs+=('--extended-regexp')
+
+# Evil regex -- scripts detecting pattern are excluded from checking.
+gargs+=('-e' 'Apache License')
+
+# Good regex -- no false positives.
+gargs+=('-e' 'Copyright[[:space:]]+[[:digit:]]{4}')
+
+while IFS= read -r -d '' path
+do
+ if ! grep -q "${gargs[@]}" "${path}";
+ then
+ echo "ERROR: $path does not contain License Header"
+ fail_licensecheck=1
+ fi
+done < <(find . -name ".git" -prune -o -type f \
+ ! -iname "*.png" \
+ ! -name "*.asc" \
+ ! -name "*.bat" \
+ ! -name "*.bin" \
+ ! -name "*.cert" \
+ ! -name "*.cfg" \
+ ! -name "*.cnf" \
+ ! -name "*.conf" \
+ ! -name "*.cql" \
+ ! -name "*.crt" \
+ ! -name "*.csar" \
+ ! -name "*.csr" \
+ ! -name "*.csv" \
+ ! -name "*.ctmpl" \
+ ! -name "*.curl" \
+ ! -name "*.db" \
+ ! -name "*.der" \
+ ! -name "*.desc" \
+ ! -name "*.diff" \
+ ! -name "*.dnsmasq" \
+ ! -name "*.do" \
+ ! -name "*.docx" \
+ ! -name "*.eot" \
+ ! -name "*.gif" \
+ ! -name "*.gpg" \
+ ! -name "*.graffle" \
+ ! -name "*.ico" \
+ ! -name "*.iml" \
+ ! -name "*.in" \
+ ! -name "*.inc" \
+ ! -name "*.install" \
+ ! -name "*.j2" \
+ ! -name "*.jar" \
+ ! -name "*.jks" \
+ ! -name "*.jpg" \
+ ! -name "*.json" \
+ ! -name "*.jsonld" \
+ ! -name "*.JSON" \
+ ! -name "*.key" \
+ ! -name "*.list" \
+ ! -name "*.local" \
+ ! -path "*.lock" \
+ ! -name "*.log" \
+ ! -name "*.mak" \
+ ! -name "*.md" \
+ ! -name "*.MF" \
+ ! -name "*.oar" \
+ ! -name "*.p12" \
+ ! -name "*.patch" \
+ ! -name "*.pb.go" \
+ ! -name "*.pb.gw.go" \
+ ! -name "*.pdf" \
+ ! -name "*.pcap" \
+ ! -name "*.pem" \
+ ! -name "*.properties" \
+ ! -name "*.proto" \
+ ! -name "*.protoset" \
+ ! -name "*.pyc" \
+ ! -name "*.repo" \
+ ! -name "*.robot" \
+ ! -name "*.rst" \
+ ! -name "*.rules" \
+ ! -name "*.service" \
+ ! -name "*.svg" \
+ ! -name "*.swp" \
+ ! -name "*.tar" \
+ ! -name "*.tar.gz" \
+ ! -name "*.toml" \
+ ! -name "*.ttf" \
+ ! -name "*.txt" \
+ ! -name "*.woff" \
+ ! -name "*.xproto" \
+ ! -name "*.xtarget" \
+ ! -name "*ignore" \
+ ! -name "*rc" \
+ ! -name "*_pb2.py" \
+ ! -name "*_pb2_grpc.py" \
+ ! -name "Dockerfile" \
+ ! -name "Dockerfile.*" \
+ ! -name "go.mod" \
+ ! -name "go.sum" \
+ ! -name "README" \
+ ! -path "*/vendor/*" \
+ ! -path "*conf*" \
+ ! -path "*git*" \
+ ! -path "*swagger*" \
+ ! -path "*.drawio" \
+ ! -name "*.pb.h" \
+ ! -name "*.pb.cc" \
+ ! -path "*/docs/*" \
+ ! -name 'output.xml' \
+ ! -path "*/vst_venv/*" \
+ ! -name '*#*' \
+ ! -path '*scripts/flog/*' \
+ ! -name '*~' \
+ ! -name 'VERSION' \
+ ! -name 'patch' \
+ -print0 )
+
+exit ${fail_licensecheck}
diff --git a/makefiles/lint/license/license-helper.sh b/makefiles/lint/license/license-helper.sh
new file mode 100755
index 0000000..499f854
--- /dev/null
+++ b/makefiles/lint/license/license-helper.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# -----------------------------------------------------------------------
+# Copyright 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.
+# -----------------------------------------------------------------------
+
+declare -i status=$#
+
+while [ $# -gt 0 ]; do
+ arg="$1"; shift
+ echo "ERROR: Detected missing license header: ${arg}"
+done
+
+if [ $status -ne 0 ]; then
+ exit 1
+fi
+
+/bin/true # set $?
+
+# [EOF]
diff --git a/makefiles/lint/python.mk b/makefiles/lint/python.mk
new file mode 100644
index 0000000..86503a7
--- /dev/null
+++ b/makefiles/lint/python.mk
@@ -0,0 +1,33 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+PYTHON_FILES ?= $(error PYTHON_FILES= is required)
+
+.PHONY: lint-python
+
+lint : lint-python
+
+lint-python: vst_venv
+ -source ./$</bin/activate \
+ && set -u \
+ && pylint $(PYTHON_FILES) \
+ && flake8 --max-line-length=99 --count $(PYTHON_FILES)
+
+help::
+ @echo " lint-python Syntax check using pylint and flake8"
+
+# [EOF]
diff --git a/makefiles/lint/robot.mk b/makefiles/lint/robot.mk
new file mode 100644
index 0000000..9808602
--- /dev/null
+++ b/makefiles/lint/robot.mk
@@ -0,0 +1,41 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+ROBOT_FILES ?= $(error ROBOT_FILES= is required)
+
+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
+
+
+.PHONY: lint-robot
+
+lint : lint-robot
+
+lint-robot: vst_venv
+ source ./$</bin/activate \
+ && set -u \
+ && rflint $(LINT_ARGS) $(ROBOT_FILES)
+
+help::
+ @echo " lint-robot Syntax check robot sources using rflint"
+
+# [EOF]
diff --git a/makefiles/lint/shell.mk b/makefiles/lint/shell.mk
new file mode 100644
index 0000000..da92921
--- /dev/null
+++ b/makefiles/lint/shell.mk
@@ -0,0 +1,33 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+JSON_FILES ?= $(error JSON_FILES= is required)
+
+.PHONY: lint-shell
+
+lint : lint-shell
+
+lint-shell:
+ shellcheck --version
+ find . \( -name 'staging' -o -name 'vst_venv' \) -prune \
+ -o -name '*.sh' ! -name 'activate.sh' -print0 \
+ | xargs -0 -n1 shellcheck
+
+help::
+ @echo " lint-shell Syntax check bash,bourne,etc sources"
+
+# [EOF]
diff --git a/makefiles/lint/yaml.mk b/makefiles/lint/yaml.mk
new file mode 100644
index 0000000..c9cb392
--- /dev/null
+++ b/makefiles/lint/yaml.mk
@@ -0,0 +1,32 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+YAML_FILES ?= $(error YAML_FILES= is required)
+
+.PHONY: lint-yaml
+
+lint : lint-yaml
+
+lint-yaml: vst_venv
+ source ./$</bin/activate \
+ ; set -u \
+ ; yamllint -s $(YAML_FILES)
+
+help::
+ @echo " lint-yaml Syntax check yaml source using yamllint"
+
+# [EOF]
diff --git a/makefiles/todo.mk b/makefiles/todo.mk
new file mode 100644
index 0000000..ac9231e
--- /dev/null
+++ b/makefiles/todo.mk
@@ -0,0 +1,40 @@
+# -*- 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.
+#
+# SPDX-FileCopyrightText: 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help::
+ @echo " todo Display future enhancement list"
+
+todo ::
+ @echo
+ @echo "[TODO: voltctl]"
+ @echo " o vendor/ is under revision control."
+ @echo " - go mod vendor will remove and recreate: invalid git state"
+ @echo " - delete vendor/ checkin and/or clone from a central repository."
+ @echo " o Review handling of targets clean and distclean:"
+ @echo " - clean removes generated targets"
+ @echo " - distclean/sterile should revert to a pristine checkout state"
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/tosca-configs/att-workflow/adtran-munich-fabric.yaml b/tosca-configs/att-workflow/adtran-munich-fabric.yaml
index db58963..a2ef71e 100644
--- a/tosca-configs/att-workflow/adtran-munich-fabric.yaml
+++ b/tosca-configs/att-workflow/adtran-munich-fabric.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/att-workflow/bbwf-cig-olt.yaml b/tosca-configs/att-workflow/bbwf-cig-olt.yaml
index ad5dbdf..ad057cc 100755
--- a/tosca-configs/att-workflow/bbwf-cig-olt.yaml
+++ b/tosca-configs/att-workflow/bbwf-cig-olt.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/att-workflow/onlab-pod1-olt.yaml b/tosca-configs/att-workflow/onlab-pod1-olt.yaml
index 8417304..93aa56f 100755
--- a/tosca-configs/att-workflow/onlab-pod1-olt.yaml
+++ b/tosca-configs/att-workflow/onlab-pod1-olt.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/att-workflow/onlab-pod2-fabric.yaml b/tosca-configs/att-workflow/onlab-pod2-fabric.yaml
index 5ff15fa..c041dcc 100755
--- a/tosca-configs/att-workflow/onlab-pod2-fabric.yaml
+++ b/tosca-configs/att-workflow/onlab-pod2-fabric.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/bbsim/bbsim-16.yaml b/tosca-configs/bbsim/bbsim-16.yaml
index bab7fb4..51705c4 100644
--- a/tosca-configs/bbsim/bbsim-16.yaml
+++ b/tosca-configs/bbsim/bbsim-16.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/bbsim/bbsim-2.yaml b/tosca-configs/bbsim/bbsim-2.yaml
index 1477ea8..f2df614 100644
--- a/tosca-configs/bbsim/bbsim-2.yaml
+++ b/tosca-configs/bbsim/bbsim-2.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.
diff --git a/tosca-configs/rcord-topdown/flex-pod1-olt-subscriber.yaml b/tosca-configs/rcord-topdown/flex-pod1-olt-subscriber.yaml
index 3d4b64e..5602b68 100755
--- a/tosca-configs/rcord-topdown/flex-pod1-olt-subscriber.yaml
+++ b/tosca-configs/rcord-topdown/flex-pod1-olt-subscriber.yaml
@@ -1,4 +1,4 @@
-# Copyright 2017-present Open Networking Foundation
+# 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.