Skip to content

Commit a3afd5c

Browse files
Update silly-sample + gitignore vscode (#253) (#285)
Modernized to include more violations that we could potentially detect Combined with cfg-sample Also gitignore vscode stuff now --------- Co-authored-by: Aaron Liu <[email protected]>
1 parent b2d18ad commit a3afd5c

13 files changed

Lines changed: 106 additions & 303 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ target/
7878
profile_default/
7979
ipython_config.py
8080

81+
# VSCode
82+
.vscode/
83+
8184
# pyenv
8285
.python-version
8386

cpplint_clitest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ def testVlcSample(self):
185185
self.checkAllInFolder('./samples/vlc-sample', 1)
186186

187187
def testSillySample(self):
188-
self.checkAllInFolder('./samples/silly-sample', 4)
189-
190-
def testCfgFileSample(self):
191-
self.checkAllInFolder('./samples/cfg-file', 1)
188+
self.checkAllInFolder('./samples/silly-sample', 5)
192189

193190
def testBoostSample(self):
194191
self.checkAllInFolder('./samples/boost-sample', 4)

samples/cfg-file/CPPLINT.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/cfg-file/src/sillycode.cpp

Lines changed: 0 additions & 262 deletions
This file was deleted.

samples/silly-sample/.cpplint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set noparent
2+
filter=-build/namespaces, -whitespace,+whitespace/line_length,-build/include_what_you_use
3+
headers=w

samples/silly-sample/CPPLINT.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set noparent
2+
linelength=84
3+
headers=omg, w
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
src/*.cpp
1+
--config=.cpplint src/*
22
1
3-
3
3+
4
44
Done processing src/sillycode.cpp
5-
Total errors found: 18
5+
Done processing src/sillycode.w
6+
Total errors found: 26
67

78
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]
8-
src/sillycode.cpp:3: Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
9+
src/sillycode.cpp:2: <ratio> is an unapproved C++11 header. [build/c++11] [5]
10+
src/sillycode.cpp:3: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
11+
src/sillycode.cpp:4: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
912
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2]
1013
src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4]
1114
src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [4]
1215
src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [4]
1316
src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [4]
17+
src/sillycode.cpp:86: Lines should be <= 80 characters long [whitespace/line_length] [2]
1418
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2]
1519
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2]
1620
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2]
@@ -21,5 +25,10 @@ src/sillycode.cpp:199: If an else has a brace on one side, it should have it on
2125
src/sillycode.cpp:208: Static/global string variables are not permitted. [runtime/string] [4]
2226
src/sillycode.cpp:227: Static/global string variables are not permitted. [runtime/string] [4]
2327
src/sillycode.cpp:228: Using C-style cast. Use reinterpret_cast<double*>(...) instead [readability/casting] [4]
28+
src/sillycode.cpp:243: Lines should be <= 80 characters long [whitespace/line_length] [2]
2429
src/sillycode.cpp:243: Using C-style cast. Use reinterpret_cast<derived2*>(...) instead [readability/casting] [4]
30+
src/sillycode.cpp:244: Lines should be <= 80 characters long [whitespace/line_length] [2]
31+
src/sillycode.cpp:249: Lines should be <= 80 characters long [whitespace/line_length] [2]
32+
src/sillycode.w:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]
33+
src/sillycode.w:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_SILLY_SAMPLE_SRC_SILLYCODE_W_ [build/header_guard] [5]
2534

samples/silly-sample/filters.def

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
1
33
7
44
Done processing src/sillycode.cpp
5-
Category 'build' errors found: 1
5+
Category 'build' errors found: 5
66
Category 'legal' errors found: 1
77
Category 'readability' errors found: 4
88
Category 'runtime' errors found: 12
9-
Total errors found: 18
9+
Total errors found: 22
1010

1111
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]
12-
src/sillycode.cpp:3: Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
12+
src/sillycode.cpp:1: Include the directory when naming header files [build/include_subdir] [4]
13+
src/sillycode.cpp:2: <ratio> is an unapproved C++11 header. [build/c++11] [5]
14+
src/sillycode.cpp:3: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
15+
src/sillycode.cpp:4: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4]
16+
src/sillycode.cpp:5: Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5]
1317
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2]
1418
src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4]
1519
src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [4]

0 commit comments

Comments
 (0)