This is an automated email from the ASF dual-hosted git repository. bbannier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 2232d48ce5b07c4e094c6850cb28212495824110 Author: Benjamin Bannier <[email protected]> AuthorDate: Wed Sep 18 11:37:09 2019 +0200 Moved cpplint configuration into dedicated file. With this change we not only reduce the amount of code in `support/mesos-style.py` in favor of a configuration supported by upstream, but we also make it easier to interoperate with editor integrations for cpplint. Review: https://reviews.apache.org/r/70096/ --- bootstrap | 4 ++++ bootstrap.bat | 4 ++++ support/CPPLINT.cfg | 2 ++ support/gitignore | 1 + support/mesos-style.py | 28 ++-------------------------- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/bootstrap b/bootstrap index 7be2cc9..a8b0da1 100755 --- a/bootstrap +++ b/bootstrap @@ -80,6 +80,10 @@ if test ! -e .clang-tidy; then ln -s support/clang-tidy .clang-tidy fi +if test ! -e CPPLINT.cfg; then + ln -s support/CPPLINT.cfg CPPLINT.cfg +fi + if [ -n "$AUTOMAKE" ] || [ -n "$ACLOCAL" ] ; then if [ -z "$ACLOCAL" ] || [ -z "$AUTOMAKE" ] ; then _present="AUTOMAKE" diff --git a/bootstrap.bat b/bootstrap.bat index 584b5c3..41447db 100644 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -56,6 +56,10 @@ if not exist .clang-format ( mklink .clang-format support\clang-format ) +if not exist CPPLINT.cfg ( + mklink CPPLINT.cfg support\CPPLINT.cfg +) + goto:eof diff --git a/support/CPPLINT.cfg b/support/CPPLINT.cfg new file mode 100644 index 0000000..b881c71 --- /dev/null +++ b/support/CPPLINT.cfg @@ -0,0 +1,2 @@ +set noparent +filter=-,+build/class,+build/deprecated,+build/endif_comment,+readability/todo,+readability/namespace,+runtime/vlog,+whitespace/blank_line,+whitespace/comma,+whitespace/end_of_line,+whitespace/ending_newline,+whitespace/forcolon,+whitespace/indent,+whitespace/line_length,+whitespace/operators,+whitespace/semicolon,+whitespace/tab,+whitespace/comments,+whitespace/todo diff --git a/support/gitignore b/support/gitignore index 7218eda..484b912 100644 --- a/support/gitignore +++ b/support/gitignore @@ -5,6 +5,7 @@ .clang-format .clang-tidy .reviewboardrc +CPPLINT.cfg Makefile.in aclocal.m4 ar-lib diff --git a/support/mesos-style.py b/support/mesos-style.py index cd490bd..b3e20fd 100755 --- a/support/mesos-style.py +++ b/support/mesos-style.py @@ -259,35 +259,11 @@ class CppLinter(LinterBase): http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py """ - - # See cpplint.py for full list of rules. - active_rules = [ - 'build/class', - 'build/deprecated', - 'build/endif_comment', - 'readability/todo', - 'readability/namespace', - 'runtime/vlog', - 'whitespace/blank_line', - 'whitespace/comma', - 'whitespace/end_of_line', - 'whitespace/ending_newline', - 'whitespace/forcolon', - 'whitespace/indent', - 'whitespace/line_length', - 'whitespace/operators', - 'whitespace/semicolon', - 'whitespace/tab', - 'whitespace/comments', - 'whitespace/todo'] - - rules_filter = '--filter=-,+' + ',+'.join(active_rules) - # We do not use a version of cpplint available through pip as # we use a custom version (see cpplint.path) to lint C++ files. process = subprocess.Popen( - [sys.executable, 'support/cpplint.py', '--extensions=hpp,cpp', - rules_filter] + source_paths, + [sys.executable, 'support/cpplint.py', '--extensions=hpp,cpp'] + + source_paths, stderr=subprocess.PIPE, close_fds=True)
