lint-doc8 exclusion string fixes
makefiles/lint/doc8/doc8.mk
---------------------------
o Added debug flag LINT_DOC8_DEBUG=1 for the module.
o Unwind iteration loop constructing exclusion command line arguments.
o Display each pattern digested when DEBUG is enabled.
o Remove double-quotes from --ignore-path "$(dir)", re-quoting single
quoted exclusion strings added by excl.mk will corrupt them.
Change-Id: I324a9d4885be53c038170890e6a82aadfd9cd89a
diff --git a/makefiles/lint/doc8/doc8.mk b/makefiles/lint/doc8/doc8.mk
index 04101fe..0a0dbf1 100644
--- a/makefiles/lint/doc8/doc8.mk
+++ b/makefiles/lint/doc8/doc8.mk
@@ -15,6 +15,10 @@
# limitations under the License.
# -----------------------------------------------------------------------
+$(if $(DEBUG),$(eval LINT_DOC8_DEBUG=1))
+
+$(if $(LINT_DOC8_DEBUG),$(warning ENTER))
+
##-------------------##
##---] GLOBALS [---##
##-------------------##
@@ -47,13 +51,28 @@
lint-doc8-src : lint-doc8
## -----------------------------------------------------------------------
+## Intent: Morph exclusion strings into command line arguments.
+## NOTE: Do not double-quote argument: -ignore-path "$(dir)"
+## Single quotes surrounding exclusion strings added in doc8/excl.mk
+## will become part of exclusion string and fail pattern matching.
## -----------------------------------------------------------------------
-## [TODO] - move lint-doc8-excl into doc8.ini
-lint-doc8-excl := $(foreach dir,$(onf-excl-dirs) $(lint-doc8-excl),--ignore-path "$(dir)")
+## [TODO] - move lint-doc8-excl into doc8.ini (autogenerate)
+## -----------------------------------------------------------------------
+lint-doc8-excl := $(strip \
+ $(foreach dir,$(onf-excl-dirs) $(lint-doc8-excl-raw),\
+ $(if $(LINT_DOC8_DEBUG),$(info ** linux-doc8-excl += [$(dir)]))\
+ --ignore-path $(dir))\
+)
+
+## -----------------------------------------------------------------------
+## Usage: make lint-doc8 LINT_DOC8_DEBUG=1
+## -----------------------------------------------------------------------
lint-doc8: lint-doc8-cmd-version
$(call banner-enter,Target $@)
$(activate) && doc8 $(lint-doc8-excl) $(lint-doc8-args)
$(call banner-enter,Target $@)
+$(if $(LINT_DOC8_DEBUG),$(warning LEAVE))
+
# [EOF]