File tree Expand file tree Collapse file tree 35 files changed +141
-73
lines changed
multi-line-function-call1
multi-line-function-call2
multi-line-function-call3 Expand file tree Collapse file tree 35 files changed +141
-73
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ add_subdirectory(validate-trace-xml-schema)
69
69
add_subdirectory (cbmc-primitives )
70
70
add_subdirectory (goto-interpreter )
71
71
add_subdirectory (cbmc-sequentialization )
72
+ add_subdirectory (cpp-linter )
72
73
73
74
if (WITH_MEMORY_ANALYZER )
74
75
add_subdirectory (snapshot-harness )
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ DIRS = cbmc \
42
42
cbmc-primitives \
43
43
goto-interpreter \
44
44
cbmc-sequentialization \
45
+ cpp-linter \
45
46
# Empty last line
46
47
47
48
ifeq ($(OS ) ,Windows_NT)
Original file line number Diff line number Diff line change
1
+ add_test_pl_tests ("../../../scripts/cpplint.py" )
Original file line number Diff line number Diff line change 1
1
default : tests.log
2
2
3
3
test :
4
- @../test.pl -p -c " python ../../../scripts/cpplint.py"
4
+ @../test.pl -p -c ../../../scripts/cpplint.py
5
5
6
6
tests.log : ../test.pl
7
- @../test.pl -p -c " python ../../../scripts/cpplint.py"
7
+ @../test.pl -p -c ../../../scripts/cpplint.py
8
8
9
9
show :
10
10
@for dir in * ; do \
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:8: assert is deprecated, use INVARIANT instead \[build/deprecated\] \[4\]
5
- ^Total errors found: 1$
4
+ ^regression/cpp-linter/assert/main\.cpp:8: assert is deprecated, use UNREACHABLE instead \[build/deprecated\] \[4\]
5
+ ^# Total errors found: 1$
6
+ ^EXIT=1$
6
7
^SIGNAL=0$
Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ Author: Thomas Kiley, thomas@diffblue.com
6
6
7
7
\*******************************************************************/
8
8
9
+ // clang-format off
9
10
class temp_classt : public base_classt
10
11
{}
11
12
12
- class another_class : public base_classt
13
+ class another_class : public base_classt
13
14
{}
14
15
15
- class more_class :public base_classt
16
+ class more_class : public base_classt
16
17
{}
17
18
18
19
class nonderived
@@ -41,3 +42,4 @@ class testt
41
42
template <class U >
42
43
void bar (U t);
43
44
}
45
+ // clang-format on
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:9: There shouldn.t be a space between class identifier and : \[readability/identifiers\] \[4\]$
5
- ^main\.cpp:12: There shouldn.t be a space between class identifier and : \[readability/identifiers\] \[4\]$
6
- ^main\.cpp:12: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
7
- ^main\.cpp:15: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
8
- ^main\.cpp:18: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
9
- ^main\.cpp:26: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
10
- ^main\.cpp:30: Remove spaces around < \[whitespace/operators\] \[4\]$
11
- ^main\.cpp:36: Remove spaces around < \[whitespace/operators\] \[4\]$
12
- ^Total errors found: 8$
4
+ ^regression/cpp-linter/class-decl-space/main\.cpp:13: There should be a space between class identifier and : \[readability/identifier_spacing\] \[4\]$
5
+ ^regression/cpp-linter/class-decl-space/main\.cpp:16: There should be a space between class identifier and : \[readability/identifier_spacing\] \[4\]$
6
+ ^regression/cpp-linter/class-decl-space/main\.cpp:13: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
7
+ ^regression/cpp-linter/class-decl-space/main\.cpp:16: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
8
+ ^regression/cpp-linter/class-decl-space/main\.cpp:19: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
9
+ ^regression/cpp-linter/class-decl-space/main\.cpp:27: Class or struct identifier should end with t \[readability/identifiers\] \[4\]$
10
+ ^# Total errors found: 6$
11
+ ^EXIT=1$
13
12
^SIGNAL=0$
14
13
--
14
+ --
15
+ The following patters are disabled as the corresponding checks in cpplint.py
16
+ were commented out in 56aea470fd6 for they yield too many false positives:
17
+ ^regression/cpp-linter/class-decl-space/main\.cpp:31: Remove spaces around < \[whitespace/operators\] \[4\]$
18
+ ^regression/cpp-linter/class-decl-space/main\.cpp:37: Remove spaces around < \[whitespace/operators\] \[4\]$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:31: Empty loop bodies should use \{\} or continue \[whitespace/empty_loop_body\] \[5\]$
5
- ^main\.cpp:38: Empty loop bodies should use \{\} or continue \[whitespace/empty_loop_body\] \[5\]$
6
- ^Total errors found: 2$
4
+ ^regression/cpp-linter/do-while1/main\.cpp:31: Empty loop bodies should use \{\} or continue \[whitespace/empty_loop_body\] \[5\]$
5
+ ^regression/cpp-linter/do-while1/main\.cpp:38: Empty loop bodies should use \{\} or continue \[whitespace/empty_loop_body\] \[5\]$
6
+ ^# Total errors found: 2$
7
+ ^EXIT=1$
7
8
^SIGNAL=0$
8
9
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:26: while statement of do...while loop should be on a separate line to the closing brace \[readability/braces\] \[4\]
5
- ^Total errors found: 1$
4
+ ^EXIT=0$
6
5
^SIGNAL=0$
7
6
--
7
+ --
8
+ Test was marked as disabled-by-default in a00edd3e6c54.
9
+ ^main\.cpp:26: while statement of do...while loop should be on a separate line to the closing brace \[readability/braces\] \[4\]
10
+ ^# Total errors found: 1$
Original file line number Diff line number Diff line change 1
- CORE
1
+ KNOWNBUG
2
2
main.cpp
3
3
4
4
^main\.cpp:26: Could not find function header comment for foo \[readability/function_comment\] \[4\]
5
- ^Total errors found: 1$
5
+ ^# Total errors found: 1$
6
+ ^EXIT=1$
6
7
^SIGNAL=0$
7
8
--
9
+ --
10
+ The checking code in cpplint.py was broken in 7302e56a348, where a wrong indent
11
+ caused the check to never take place. That's fine, however, as we don't use
12
+ these function headers anymore.
Original file line number Diff line number Diff line change 1
- CORE
1
+ KNOWNBUG
2
2
main.cpp
3
3
4
4
main\.cpp:15: Function header for fun missing Inputs: \[readability/function_comment\] \[4\]
5
5
main\.cpp:15: Function header for fun missing Outputs: \[readability/function_comment\] \[4\]
6
6
main\.cpp:15: Function header for fun missing Purpose: \[readability/function_comment\] \[4\]
7
- ^Total errors found: 3$
7
+ ^# Total errors found: 3$
8
+ ^EXIT=1$
8
9
^SIGNAL=0$
9
10
--
11
+ --
12
+ The checking code in cpplint.py was broken in 7302e56a348, where a wrong indent
13
+ caused the check to never take place. That's fine, however, as we don't use
14
+ these function headers anymore.
Original file line number Diff line number Diff line change 1
- CORE
1
+ KNOWNBUG
2
2
main.cpp
3
3
4
4
^main\.cpp:20: Insert an empty line between function header comment and the function fun \[readability/function_comment\] \[4\]$
5
- ^Total errors found: 1$
5
+ ^# Total errors found: 1$
6
+ ^EXIT=1$
6
7
^SIGNAL=0$
7
8
--
9
+ --
10
+ The checking code in cpplint.py was broken in 7302e56a348, where a wrong indent
11
+ caused the check to never take place. That's fine, however, as we don't use
12
+ these function headers anymore.
Original file line number Diff line number Diff line change 1
- CORE
1
+ KNOWNBUG
2
2
main.cpp
3
3
4
4
^main\.cpp:11: Function: name in the comment doesn.t match the function name \[readability/function_comment\] \[4\]
5
- ^Total errors found: 1$
5
+ ^# Total errors found: 1$
6
+ ^EXIT=1$
6
7
^SIGNAL=0$
7
8
--
9
+ --
10
+ The checking code in cpplint.py was broken in 7302e56a348, where a wrong indent
11
+ caused the check to never take place. That's fine, however, as we don't use
12
+ these function headers anymore.
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:24: Put braces on a separate next line \[whitespace/braces\] \[5\]$
5
- ^main\.cpp:26: Put braces on a separate next line \[whitespace/braces\] \[5\]$
6
- ^main\.cpp:26: Else if should be on a new line after closing brace \[readability/braces\] \[5\]$
7
- ^main\.cpp:28: Put braces on a separate next line \[whitespace/braces\] \[5\]$
8
- ^main\.cpp:28: Else should be on a new line after closing brace \[readability/braces\] \[5\]$
9
- ^Total errors found: 5$
4
+ ^regression/cpp-linter/if-else1/main\.cpp:26: Else if should be on a new line after closing brace \[readability/braces\] \[5\]$
5
+ ^regression/cpp-linter/if-else1/main\.cpp:28: Else should be on a new line after closing brace \[readability/braces\] \[5\]$
6
+ ^# Total errors found: 2$
7
+ ^EXIT=1$
10
8
^SIGNAL=0$
11
9
--
10
+ --
11
+ The following patters are disabled as the corresponding checks in cpplint.py
12
+ were removed in 692c4f377 for they are covered by clang-format:
13
+ ^regression/cpp-linter/if-else1/main\.cpp:24: Put braces on a separate next line \[whitespace/braces\] \[5\]$
14
+ ^regression/cpp-linter/if-else1/main\.cpp:26: Put braces on a separate next line \[whitespace/braces\] \[5\]$
15
+ ^regression/cpp-linter/if-else1/main\.cpp:28: Put braces on a separate next line \[whitespace/braces\] \[5\]$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ --
8
+ The following patters are disabled as the corresponding checks in cpplint.py
9
+ were removed in 692c4f377 for they are covered by clang-format:
4
10
^main\.cpp:23: Put braces on a separate next line \[whitespace/braces\] \[5\]$
5
11
^main\.cpp:26: Put braces on a separate next line \[whitespace/braces\] \[5\]$
6
12
^main\.cpp:29: Put braces on a separate next line \[whitespace/braces\] \[5\]$
7
- ^Total errors found: 3$
8
- ^SIGNAL=0$
9
- --
13
+ ^# Total errors found: 3$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:24: Statement after an if should be on a new line \[readability/braces\] \[5\]$
5
- ^main\.cpp:25: Statement after else if should be on a new line \[readability/braces\] \[5\]$
6
- ^main\.cpp:26: Statement after else should be on a new line \[readability/braces\] \[5\] $
7
- ^Total errors found: 3 $
4
+ ^regression/cpp-linter/if-else3/ main\.cpp:24: Statement after an if should be on a new line \[readability/braces\] \[5\]$
5
+ ^regression/cpp-linter/if-else3/ main\.cpp:25: Statement after else if should be on a new line \[readability/braces\] \[5\]$
6
+ ^# Total errors found: 2 $
7
+ ^EXIT=1 $
8
8
^SIGNAL=0$
9
9
--
10
+ --
11
+ The following patters are disabled as the corresponding checks in cpplint.py
12
+ were commented out in 56aea470fd6 for they yield too many false positives:
13
+ ^regression/cpp-linter/if-else3/main\.cpp:26: Statement after else should be on a new line \[readability/braces\] \[5\]$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^main\.cpp:24: Statement after an if should be on a new line \[readability/braces\] \[5\]$
5
- ^main\.cpp:25: Statement after else if should be on a new line \[readability/braces\] \[5\]$
6
- ^main\.cpp:26: Statement after else should be on a new line \[readability/braces\] \[5\] $
7
- ^Total errors found: 3 $
4
+ ^regression/cpp-linter/if-else4/ main\.cpp:24: Statement after an if should be on a new line \[readability/braces\] \[5\]$
5
+ ^regression/cpp-linter/if-else4/ main\.cpp:25: Statement after else if should be on a new line \[readability/braces\] \[5\]$
6
+ ^# Total errors found: 2 $
7
+ ^EXIT=1 $
8
8
^SIGNAL=0$
9
9
--
10
+ --
11
+ The following patters are disabled as the corresponding checks in cpplint.py
12
+ were commented out in 56aea470fd6 for they yield too many false positives:
13
+ ^regression/cpp-linter/if-else4/main\.cpp:26: Statement after else should be on a new line \[readability/braces\] \[5\]$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ --
8
+ The following patters are disabled as the corresponding checks in cpplint.py
9
+ were commented out in 56aea470fd6 for they yield too many false positives:
4
10
^main\.cpp:29: If parameters or arguments require a line break, each parameter should be put on its own line\. \[whitespace/indent\] \[4\]
5
11
^main\.cpp:34: Indent of wrapped parenthesized expression or parameter or argument list should be 2 \[whitespace/indent\] \[4\]
6
12
^main\.cpp:43: If parameters or arguments require a line break, each parameter should be put on its own line\. \[whitespace/indent\] \[4\]
@@ -11,7 +17,4 @@ main.cpp
11
17
^main\.cpp:76: Indent of wrapped parenthesized expression or parameter or argument list should be 2 \[whitespace/indent\] \[4\]
12
18
^main\.cpp:81: If parameters or arguments require a line break, the closing bracket should be on the same line as the final parameter \[whitespace/indent\] \[4\]
13
19
^main\.cpp:85: If parameters or arguments require a line break, each parameter should be put on its own line. \[whitespace/indent\] \[4\]
14
- ^Total errors found: 10$
15
- ^EXIT=1$
16
- ^SIGNAL=0$
17
- --
20
+ ^# Total errors found: 10$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ --
8
+ The following patters are disabled as the corresponding checks in cpplint.py
9
+ were commented out in 56aea470fd6 for they yield too many false positives:
4
10
^main\.cpp:24: If parameters or arguments require a line break, each parameter should be put on its own line\. \[whitespace/indent\] \[4\]
5
11
^main\.cpp:29: Indent of wrapped parenthesized expression or parameter or argument list should be 2 \[whitespace/indent\] \[4\]
6
12
^main\.cpp:60: If parameters or arguments require a line break, each parameter should be put on its own line\. \[whitespace/indent\] \[4\]
7
13
^main\.cpp:65: If parameters or arguments require a line break, each parameter should be put on its own line\. \[whitespace/indent\] \[4\]
8
- ^Total errors found: 4$
9
- ^EXIT=1$
10
- ^SIGNAL=0$
11
- --
14
+ ^# Total errors found: 4$
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 1
- CORE
1
+ FUTURE
2
2
main.cpp
3
3
4
4
^main\.cpp:23: Remove spaces around = \[whitespace/operators\] \[4\]
5
- ^Total errors found: 1$
5
+ ^# Total errors found: 1$
6
+ ^EXIT=1$
6
7
^SIGNAL=0$
7
8
--
9
+ --
10
+ Test disabled (marked as "FUTURE") as the corresponding checks in cpplint.py
11
+ were commented out in 56aea470fd6 for they yield too many false positives.
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^Total errors found: 0$
4
+ ^# Total errors found: 0$
5
5
^EXIT=0$
6
6
^SIGNAL=0$
7
7
--
Original file line number Diff line number Diff line change 5
5
^main\.cpp:27: Missing spaces around << \[whitespace/operators\] \[3\]
6
6
^main\.cpp:29: Remove spaces around << \[whitespace/operators\] \[4\]
7
7
^main\.cpp:29: Remove spaces around << \[whitespace/operators\] \[4\]
8
- ^Total errors found: 4$
8
+ ^# Total errors found: 4$
9
+ ^EXIT=1$
9
10
^SIGNAL=0$
10
11
--
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Author: Thomas Kiley, thomas@diffblue.com
6
6
7
7
\*******************************************************************/
8
8
9
- class test_classt : public base_classt
9
+ class test_classt : public base_classt
10
10
{
11
11
public:
12
12
virtual void fun () override final ;
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.cpp
3
3
4
- ^EXIT=0$
4
+ ^regression/cpp-linter/override-final/main\.cpp:12: "virtual" is redundant since function is already declared as "override" \[readability/inheritance\] \[4\]$
5
+ ^EXIT=1$
5
6
^SIGNAL=0$
6
7
--
You can’t perform that action at this time.
0 commit comments