Misc cleanups, add installer for lint-groovy

makefiles/npm/README.md
makefiles/npm/include.mk
makefiles/npm/nvm.mk
makefiles/npm/npm.mk
-------------------------
  o Genreate targets and deps for installing tools nvm, npm and npm-groovy-lint.
  o Tools are intended for interactive use.
  o npm-groovy-lint is a dependency for the lint-groovy target

config.mk
.gitignore
----------
  o Add exclusion lf/onf-make for repo:onf-make git submodule.
  o Add exclusion for .tmp (makefiles/nvm/nvm.mk)

makefiles/lint/groovy/groovy.mk
makefiles/lint/groovy/include.mk
makefiles/lint/groovy/install.mk
--------------------------------
  o Update targets to latest lint-{language}-{all,mod,src} syntax.
  o Installer updated to depend on npm/nvm.mk target 'npm-groovy-install'.

makefiles/lint/make/makefile.mk
makefiles/lint/json.mk
makefiles/lint/python/flake8.mk
makefiles/lint/shell/shellcheck.mk
makefiles/lint/yaml.mk
------------------------
  o Simplify find command exclusions.
  o Use "-not -path [p]" in place of "( -name p ) -prune".

makefiles/main/tempdir/tempdir.mk
---------------------------------
  o Fixed a typo $(HELP) -> $(HIDE)

makefiles/lint/doc8/doc8.ini
-------------------------------
  o Add directory exclusions from onf-excl-dir=.
  o Remove txt from the list of file extensions to check
    repo:voltha-docs is the only repo with *.txt files that contain
    restructuredText so add the extension in the local per-repository
    config.

Signed-off-by: Joey Armstrong <jarmstrong@linuxfoundation.org>
Change-Id: Ia2e091d812af82063c79ed855bc7dd4f5ec8f706
diff --git a/makefiles/lint/groovy/command.mk b/makefiles/lint/groovy/command.mk
new file mode 100644
index 0000000..9a6557b
--- /dev/null
+++ b/makefiles/lint/groovy/command.mk
@@ -0,0 +1,39 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2024 Open Networking Foundation 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-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# Intent:
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+lint-groovy-cmd := $(call node-get-tool-path,npm-groovy-lint)
+
+# lint-groovy-conf := $(call path-by-makefile,.groovylintrc.json)
+lint-groovy-conf := $(onf-mk-dir)/lint/groovy/.groovylintrc.json
+
+lint-groovy-args := $(null)
+lint-groovy-args += --config $(lint-groovy-conf)
+
+
+# lint-groovy-args += --loglevel info
+# lint-groovy-args += --ignorepattern
+# lint-groovy-args += --verbose
+
+# [EOF]
+
diff --git a/makefiles/lint/groovy/groovy.mk b/makefiles/lint/groovy/groovy.mk
new file mode 100644
index 0000000..0652bb4
--- /dev/null
+++ b/makefiles/lint/groovy/groovy.mk
@@ -0,0 +1,108 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2024 Open Networking Foundation 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-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# Intent:
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+.PHONY: lint-groovy
+.PHONY: lint-groovy-all lint-groovy-mod lint-groovy-src
+
+have-groovy-files := $(if $(strip $(GROOVY_SOURCE)),true)
+GROOVY_SOURCE     ?= $(error GROOVY_SOURCE= is required)
+
+groovy-check := $(activate-npm) && $(lint-groovy-cmd) $(lint-groovy-args)
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+
+## -----------------------------------------------------------------------
+## Intent: Enabled by repository_sandbox_root/config.mk
+## -----------------------------------------------------------------------
+ifndef NO-LINT-GROOVY
+  lint-groovy-mode := $(if $(have-groovy-files),mod,all)
+  lint-groovy : lint
+  lint-groovy : lint-groovy-$(lint-groovy-mode)
+endif# NO-LINT-GROOVY
+
+
+groovy-find-args += $(foreach dir,$(onf-excl-dirs),-not -path './$(dir)/*')
+
+## -----------------------------------------------------------------------
+## Intent: Perform a lint check on command line script sources
+## -----------------------------------------------------------------------
+lint-groovy-all: lint-groovy-version
+
+	$(call banner-enter,Target $@)
+
+	@echo
+#	$(HIDE)$(env-clean) find . \
+#-not -path './.tmp/*' \
+#-not -path "./.$(venv-name)/*" \
+
+	$(HIDE)$(env-clean) find . $(groovy-find-args) -iname '*.groovy' -print0 \
+	| $(xargs-n1) bash -c "$(groovy-check)"
+
+	$(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: On-demand lint checking
+## -----------------------------------------------------------------------
+lint-groovy-src : lint-groovy-version
+
+  ifndef GROOVY_SRC
+	@echo "ERROR: Usage: $(MAKE) $@ GROOVY_SRC="
+	@exit 1
+  endif
+
+	$(call banner-enter,Target $@)
+	@echo
+	$(HIDE) $(groovy-check) $(GROOVY_SRC)
+	$(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: Perform lint check on locally modified sources
+## -----------------------------------------------------------------------
+lint-groovy-bygit = $(git status -s | grep '\.groovy' | grep -v -e '^D' -e '^?' | cut -c4-)
+lint-groovy-mod: lint-groovy-version
+
+	$(call banner-enter,Target $@)
+	@echo
+	$(foreach fyl,$(lint-groovy-bygit),$(groovy-check) $(fyl))
+	$(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## Intent: Display command help
+## -----------------------------------------------------------------------
+help-summary ::
+	@echo '  lint-groovy          Conditionally lint groovy source'
+  ifdef VERBOSE
+	@echo '  lint-groovy-all      Lint all available sources'
+	@echo '  lint-groovy-mod      Lint locally modified (git status)'
+	@echo '  lint-groovy-src      Lint individually (BY_SRC=list-of-files)'
+  endif
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/groovy/help.mk b/makefiles/lint/groovy/help.mk
new file mode 100644
index 0000000..3268d4b
--- /dev/null
+++ b/makefiles/lint/groovy/help.mk
@@ -0,0 +1,41 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2024 Open Networking Foundation 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-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Display topic help
+## -----------------------------------------------------------------------
+help-summary ::
+	@printf '  %-33.33s %s\n' 'lint-groovy'      'Syntax check sources'
+	@printf '  %-33.33s %s\n' 'lint-groovy-help' 'Extended target help'
+
+## -----------------------------------------------------------------------
+## Intent: Display extended topic help
+## -----------------------------------------------------------------------
+.PHONY: lint-groovy-help
+lint-groovy-help ::
+	@printf '  %-33.33s %s\n' 'lint-groovy-all' 'Lint all available sources'
+	@printf '  %-33.33s %s\n' 'lint-groovy-mod' 'Lint locally modified (git status)'
+	@printf '  %-33.33s %s\n' 'lint-groovy-src' 'Lint individually (GROOVY_SRC=...)'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/groovy/include.mk b/makefiles/lint/groovy/include.mk
index 8caddd7..c1660f1 100644
--- a/makefiles/lint/groovy/include.mk
+++ b/makefiles/lint/groovy/include.mk
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 # -----------------------------------------------------------------------
-# Copyright 2022-2024 Open Networking Foundation Contributors
+# Copyright 2017-2024 Open Networking Foundation Contributors
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -14,93 +14,24 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # -----------------------------------------------------------------------
-# SPDX-FileCopyrightText: 2022-2024 Open Networking Foundation Contributors
+# SPDX-FileCopyrightText: 2017-2024 Open Networking Foundation Contributors
 # SPDX-License-Identifier: Apache-2.0
 # -----------------------------------------------------------------------
 # Intent:
 # -----------------------------------------------------------------------
 
-##-------------------##
-##---]  GLOBALS  [---##
-##-------------------##
+# ------------------------------------------------------------
+# Intent: Generate command installer targets with dependencies
+# ------------------------------------------------------------
+$(call gen-npm-install,npm-groovy-lint)
 
-groovy-check      := npm-groovy-lint
+##--------------------##
+##---]  INCLUDES  [---##
+##--------------------##
+include $(onf-mk-top)/lint/groovy/command.mk
 
-groovy-check-conf := $(call path-by-makefile,.groovylintrc.json)
-
-groovy-check-args := $(null)
-groovy-check-args += --config "$(groovy-check-conf)"
-
-# groovy-check-args += --loglevel info
-# groovy-check-args += --ignorepattern
-# groovy-check-args += --verbose
-
-##-------------------##
-##---]  TARGETS  [---##
-##-------------------##
-
-## -----------------------------------------------------------------------
-## Intent: Enabled by repository_sandbox_root/config.mk
-## -----------------------------------------------------------------------
-ifndef NO-LINT-GROOVY
-  lint : lint-groovy
-endif
-
-## -----------------------------------------------------------------------
-## All or on-demand
-##   make lint-groovy BY_SRC="a/b/c.groovy d/e/f.groovy"
-## -----------------------------------------------------------------------
-ifdef GROOVY_SRC
-  lint-groovy : lint-groovy-src
-else
-  lint-groovy : lint-groovy-all
-endif
-
-## -----------------------------------------------------------------------
-## Intent: Perform a lint check on command line script sources
-## -----------------------------------------------------------------------
-lint-groovy-all:
-
-	$(call banner-enter,Target $@)
-
-	$(groovy-check) --version
-	@echo
-	$(HIDE)$(env-clean) find . -iname '*.groovy' -print0 \
-  | $(xargs-n1) $(groovy-check) $(groovy-check-args)
-
-	$(call banner-leave,Target $@)
-
-## -----------------------------------------------------------------------
-## Intent: On-demand lint checking
-## -----------------------------------------------------------------------
-lint-groovy-src:
-  ifndef GROOVY_SRC
-	@echo "ERROR: Usage: $(MAKE) $@ GROOVY_SRC="
-	@exit 1
-  endif
-	$(groovy-check) --version
-	@echo
-	$(HIDE) $(groovy-check) $(groovy-check-args) $(GROOVY_SRC)
-
-## -----------------------------------------------------------------------
-## Intent: Perform lint check on locally modified sources
-## -----------------------------------------------------------------------
-# lint-groovy-bygit = $(shell git diff --name-only HEAD | grep '\.groovy')
-lint-groovy-bygit = $(git status -s | grep '\.sh' | grep -v -e '^D' -e '^?' | cut -c4-)
-lint-groovy-mod:
-	$(groovy-check) --version
-	@echo
-	$(foreach fyl,$(lint-groovy-bygit),$(groovy-check) $(groovy-check-args) $(fyl))
-
-## -----------------------------------------------------------------------
-## Intent: Display command help
-## -----------------------------------------------------------------------
-help-summary ::
-	@echo '  lint-groovy          Conditionally lint groovy source'
-  ifdef VERBOSE
-	@echo '  lint-groovy-all      Lint all available sources'
-	@echo '  lint-groovy-mod      Lint locally modified (git status)'
-	@echo '  lint-groovy-src      Lint individually (BY_SRC=list-of-files)'
-  endif
+include $(onf-mk-top)/lint/groovy/help.mk
+include $(onf-mk-top)/lint/groovy/install.mk
+include $(onf-mk-top)/lint/groovy/groovy.mk
 
 # [EOF]
diff --git a/makefiles/lint/groovy/install.mk b/makefiles/lint/groovy/install.mk
index 0864a3d..828e4eb 100644
--- a/makefiles/lint/groovy/install.mk
+++ b/makefiles/lint/groovy/install.mk
@@ -17,38 +17,40 @@
 # SPDX-FileCopyrightText: 2022-2024 Open Networking Foundation Contributors
 # SPDX-License-Identifier: Apache-2.0
 # -----------------------------------------------------------------------
-# Intent:
+# Intent: Install npm-groovy-lint for syntax checking
+# -----------------------------------------------------------------------
+# NOTES: Tool install dependency chain
+#    version : tool-install
+#    tool-install : npm-tool
+#    npm-tool     : npm-install
+#
+# % make npm-groovy-lint installs npm, node and npm-groovy-lint
 # -----------------------------------------------------------------------
 
-##-------------------##
-##---]  GLOBALS  [---##
-##-------------------##
-lint-groovy-cmds += $(shell which npm-groovy-lint)
-lint-groovy-cmds += $(HOME)/.npm/bin/npm-groovy-lint
-lint-groovy-cmds += /usr/bin/npm-groovy-lint
-# lint-groovy-cmds += /dev/null#                     # force existence
-
-lint-groovy-cmd = $(firstword $(wildcard $(lint-groovy-cmds)))
-
-##-------------------##
-##---]  TARGETS  [---##
-##-------------------##
-ifndef NO-LINT-GROOVY
-
-  lint : lint-groovy
-endif
+$(if $(DEBUG),$(warning ENTER))
 
 ## -----------------------------------------------------------------------
-## Intent: Install npm-groovy-lint
+## Intent: Display groovy command version string.
 ## -----------------------------------------------------------------------
-$(lint-groovy-cmd) : lint-groovy-install
-lint-groovy-install:
+.PHONY: lint-groovy-version
+lint-groovy-version : $(lint-groovy-cmd)
+	@echo
+	$(activate-npm) && "$<" --version
 
 ## -----------------------------------------------------------------------
-## Intent: Display command help
+## Intent: On-demand instalation of the groovy command
 ## -----------------------------------------------------------------------
-help-summary ::
-	@echo '  lint-groovy-install          Syntax check groovy sources'
+.PHONY: lint-groovy-install
+lint-groovy-install : $(lint-groovy-cmd)
+
+## -----------------------------------------------------------------------
+## Intent: Display command usage
+## -----------------------------------------------------------------------
+lint-groovy-help ::
+	@echo
+	@printf '  %-33.33s %s\n' 'lint-groovy-version' 'Display lint tool version'
+	@printf '  %-33.33s %s\n' 'lint-groovy-install' 'Install lint tool'
+
+	@$(MAKE) --no-print-directory npm-help
 
 # [EOF]
-