Enhance shellcheck lint target (3 of 3 -- lint-shell target logic)
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/shellcheck.sh
----------------------------------
o Enhance makefiles/shell.mk to support more lint targets.
o Three targets are now supported:
- lint-shell-all current behavior, run shellcheck on all sources
- lint-shell-mod new: lint locally modified files (~git status)
- lint-shell-src new: run shellcheck on a list of files passed in.
o Added helper function gen-lint-shell-deps:
- generate a list of dependency based on makefile target.
- dependency list is assigned to a variable named for the target.
- avoids having to inline duplicate construction around targets.
o Each target lint-shell-{all,mod,src} defines a list of
dependencies/files to launch shellcheck on.
o Target dependency lists allowed replacing "find | xargs shellcheck"
commands with an explicit per-source-to-check target.
o Structure will also allow supporting exclusion lists in the future.
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: Id6ed1f66f80e63b4cc1c857f56c1fa342635df62
diff --git a/makefiles/lint/shell/include.mk b/makefiles/lint/shell/include.mk
new file mode 100644
index 0000000..63797d5
--- /dev/null
+++ b/makefiles/lint/shell/include.mk
@@ -0,0 +1,29 @@
+# -*- 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))
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+-include $(ONF_MAKEDIR)/lint/shell/help.mk
+-include $(ONF_MAKEDIR)/lint/shell/install.mk
+include $(ONF_MAKEDIR)/lint/shell/shellcheck.mk
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]