Enhance shellcheck lint target (1 of 3 -- help.mk)
makefiles/lint/shell/help.mk
----------------------------
o Top level include used to source all lint-shell library makefiles.
o Loosely based on makefiles/{groovy,doc8}/*.
o Currently library makefile makefiles/shell.mk deprecation pending.
o Prefix yet-to-be-added makefile includes with hyphen to prevent errors.
makefiles/lint/shell/help.mk
----------------------------
o Document new lint-shell makefile convenience targets being added.
o 'make help' will display a target summary for lint-shell:
- primary lint target name
- target name used to display extended help.
o 'make lint-shell-help' will display extended help (3 targets):
- make lint-shell-all (current target behavior)
- make lint-shell-mod (limit shellcheck to locally modified files)
- make lint-shell-src (shellcheck a list of files passd in)
o Targets can be explicitly used by name.
o One of the three targets will become a dependency for:
- make lint # if shellcheck is a default repository lint target.
- make lint-shell # common target name for shellcheck linting.
unit-testing:
Helper script mcheck.sh will create a usable sandbox from shellcheck patches to evaluate targets.
shellcheck (make lint-shell*) will report problems in bin/setup.sh:
o https://wiki.opennetworking.org/display/VOLTHA/repo%3Aonf-make
Change-Id: I5a7f6c9b4c43ce973b65900b097977d422be8aa5
diff --git a/makefiles/lint/shell/help.mk b/makefiles/lint/shell/help.mk
new file mode 100644
index 0000000..3276f0f
--- /dev/null
+++ b/makefiles/lint/shell/help.mk
@@ -0,0 +1,46 @@
+# -*- 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.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Display topic help
+## -----------------------------------------------------------------------
+help-summary ::
+ @printf ' %-30s %s\n' 'lint-shell'\
+ 'Run shellcheck on sources'
+ @printf ' %-30s %s\n' 'lint-shell-help'\
+ 'Show verbose target help'
+ ifdef VERBOSE
+ @$(MAKE) --no-print-directory lint-shell-help
+ endif
+
+## -----------------------------------------------------------------------
+## Intent: Display extended topic help
+## -----------------------------------------------------------------------
+.PHONY: lint-shell-help
+lint-shell-help ::
+ @printf ' %-30s %s\n' 'lint-shell-all'\
+ 'Shellcheck available sources'
+ @printf ' %-30s %s\n' 'lint-shell-mod'\
+ 'Shellcheck locally modified files (git status)'
+ @printf ' %-30s %s\n' 'lint-shell-src'\
+ 'Shellcheck files by path'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/lint/shell/include.mk b/makefiles/lint/shell/include.mk
index 293947f..78c1f48 100644
--- a/makefiles/lint/shell/include.mk
+++ b/makefiles/lint/shell/include.mk
@@ -20,7 +20,7 @@
##--------------------##
##---] INCLUDES [---##
##--------------------##
--include $(ONF_MAKEDIR)/lint/shell/help.mk
+include $(ONF_MAKEDIR)/lint/shell/help.mk
include $(ONF_MAKEDIR)/lint/shell/install.mk
include $(ONF_MAKEDIR)/lint/shell/shellcheck.mk