From ed6611a588e2f21be60db11dc75f69e40500ea1f Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Thu, 25 Jun 2015 23:48:12 -0400 Subject: [PATCH 1/2] clint.py: don't print `--help` output to stderr and exit 1 a) It's not an error b) It requires manual redirection of stderr into stdout ('2>&1') in order to be viewed with a pager, which it warrants given how long the help message is. Helped-by: Florian Walch --- clint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clint.py b/clint.py index ccf1c11c3d..9715edd54e 100755 --- a/clint.py +++ b/clint.py @@ -3079,11 +3079,12 @@ def PrintUsage(message): Args: message: The optional error message. """ - sys.stderr.write(_USAGE) if message: + sys.stderr.write(_USAGE) sys.exit('\nFATAL ERROR: ' + message) else: - sys.exit(1) + sys.stdout.write(_USAGE) + sys.exit(0) def PrintCategories(): @@ -3091,7 +3092,7 @@ def PrintCategories(): These are the categories used to filter messages via --filter. """ - sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) + sys.stdout.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0) From 3c2fa1767b452a3445068a2806886c90bacbf543 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Thu, 25 Jun 2015 23:51:23 -0400 Subject: [PATCH 2/2] cmake: Make `make lint` less verbose It unnecessarily complicates spotting linter errors, as they're usually surrounded by a bunch of lines saying "Done processing ... ". --- clint.py | 2 -- cmake/RunLint.cmake | 2 -- 2 files changed, 4 deletions(-) diff --git a/clint.py b/clint.py index 9715edd54e..097b54f1c1 100755 --- a/clint.py +++ b/clint.py @@ -3070,8 +3070,6 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): 'One or more unexpected \\r (^M) found;' 'better to use only a \\n') - sys.stderr.write('Done processing %s\n' % filename) - def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. diff --git a/cmake/RunLint.cmake b/cmake/RunLint.cmake index 35d3f942aa..a6d5a01b50 100644 --- a/cmake/RunLint.cmake +++ b/cmake/RunLint.cmake @@ -5,9 +5,7 @@ file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h) if(LINT_IGNORE_FILE) file(READ ${LINT_IGNORE_FILE} LINT_IGNORED_FILES) string(REPLACE "\n" ";" LINT_IGNORED_FILES ${LINT_IGNORED_FILES}) - message(STATUS "Ignoring the following files for linting:") foreach(ignore_file ${LINT_IGNORED_FILES}) - message(STATUS "${ignore_file}") list(REMOVE_ITEM LINT_FILES "${LINT_PREFIX}/${ignore_file}") endforeach() endif()