flake8
-
bot/reviewbot/tools/cppcheck.py (Diff revision 1) Show all issues -
-
Review Request #10067 — Created July 4, 2018 and submitted
cppcheck will fallback to C language if it checks a .h file. A lot of C++ applications uses .h for C++ header. So cppcheck will add issues for C++ only keywords like a "namespace". This change adds another option to force cppcheck to use given language.
Description | From | Last Updated |
---|---|---|
E999 SyntaxError: invalid syntax |
![]() |
|
E501 line too long (81 > 79 characters) |
![]() |
|
E112 expected an indented block |
![]() |
|
This isn't a compatibility-breaking change, so we shouldn't change the tool version. |
|
|
Is it likely that this will ever support more? Perhaps we should change this to use a ChoiceField and give … |
|
|
"options" is a funky name for this, because it ends up being turned into a single arg. How about: cppcheck_args … |
|
bot/reviewbot/tools/cppcheck.py (Diff revision 1) |
---|
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+19 -1) |
bot/reviewbot/tools/cppcheck.py (Diff revision 2) |
---|
This isn't a compatibility-breaking change, so we shouldn't change the tool version.
bot/reviewbot/tools/cppcheck.py (Diff revision 2) |
---|
Is it likely that this will ever support more? Perhaps we should change this to use a ChoiceField and give it the options "auto-detect", "C", and "C++"
bot/reviewbot/tools/cppcheck.py (Diff revision 2) |
---|
"options" is a funky name for this, because it ends up being turned into a single arg. How about:
cppcheck_args = [ 'cppcheck', '--template=\"{file}::{line}::{severity}::{id}::{message}\"', '--enable=%s' % enable_settings, ] lang = settings['force_language'].strip() if lang: cppcheck_args.append('--language=%s' % lang) cppcheck_args.append(path) output = execute(cppcheck_args, split_lines=True, ingore_errors=True)
That way future optional things can also be added easily.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+29 -9) |