Skip to content

Commit

Permalink
build: toggle lint-cpp using verbose (V) variable
Browse files Browse the repository at this point in the history
This commit the verbosity of cpplint to be toggled by using the V
variable. The default setting is verbose but by passing an empty string
cpplint will be quiet.

PR-URL: #23217
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
danbev authored and jasnell committed Oct 17, 2018
1 parent 0b80ab9 commit e7aba48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1181,19 +1181,25 @@ else
@echo "To install (requires internet access) run: $ make format-cpp-build"
endif

ifeq ($(V),1)
CPPLINT_QUIET =
else
CPPLINT_QUIET = --quiet
endif
.PHONY: lint-cpp
# Lints the C++ code with cpplint.py and check-imports.py.
lint-cpp: tools/.cpplintstamp

tools/.cpplintstamp: $(LINT_CPP_FILES)
@echo "Running C++ linter..."
@$(PYTHON) tools/cpplint.py --quiet $?
@$(PYTHON) tools/cpplint.py $(CPPLINT_QUIET) $?
@$(PYTHON) tools/check-imports.py
@touch $@

lint-addon-docs: test/addons/.docbuildstamp
@echo "Running C++ linter on addon docs..."
@$(PYTHON) tools/cpplint.py --quiet --filter=$(ADDON_DOC_LINT_FLAGS) $(LINT_CPP_ADDON_DOC_FILES_GLOB)
@$(PYTHON) tools/cpplint.py $(CPPLINT_QUIET) --filter=$(ADDON_DOC_LINT_FLAGS) \
$(LINT_CPP_ADDON_DOC_FILES_GLOB)

cpplint: lint-cpp
@echo "Please use lint-cpp instead of cpplint"
Expand Down

0 comments on commit e7aba48

Please sign in to comment.