-
Notifications
You must be signed in to change notification settings - Fork 295
Don't err on non-const references by default #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f856963
073ebe4
404f56e
7654e19
a3b87cd
7afdc3a
142486f
4856c23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,17 @@ | |
4 | ||
Done processing src/sillycode.cpp | ||
Done processing src/sillycode.w | ||
Total errors found: 26 | ||
Total errors found: 21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we finding fewer expected errors? |
||
|
||
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] | ||
src/sillycode.cpp:2: <ratio> is an unapproved C++11 header. [build/c++11] [5] | ||
src/sillycode.cpp:3: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:4: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2] | ||
src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] | ||
src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:86: Lines should be <= 80 characters long [whitespace/line_length] [2] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:171: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1] | ||
src/sillycode.cpp:178: Static/global string variables are not permitted. [runtime/string] [4] | ||
src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,24 +5,19 @@ Done processing src/sillycode.cpp | |
Category 'build' errors found: 5 | ||
Category 'legal' errors found: 1 | ||
Category 'readability' errors found: 4 | ||
Category 'runtime' errors found: 12 | ||
Total errors found: 22 | ||
Category 'runtime' errors found: 7 | ||
Total errors found: 17 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we finding fewer expected errors? |
||
|
||
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] | ||
src/sillycode.cpp:1: Include the directory when naming header files [build/include_subdir] [4] | ||
src/sillycode.cpp:2: <ratio> is an unapproved C++11 header. [build/c++11] [5] | ||
src/sillycode.cpp:3: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:4: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:5: Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5] | ||
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2] | ||
src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] | ||
src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [4] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:171: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1] | ||
src/sillycode.cpp:178: Static/global string variables are not permitted. [runtime/string] [4] | ||
src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
1 | ||
3 | ||
Done processing src/sillycode.cpp | ||
Total errors found: 123 | ||
Total errors found: 118 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we finding fewer expected errors? |
||
|
||
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] | ||
src/sillycode.cpp:1: Include the directory when naming header files [build/include_subdir] [4] | ||
|
@@ -13,7 +13,6 @@ src/sillycode.cpp:3: Found other system header after other header. Should be: s | |
src/sillycode.cpp:4: Found other system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:5: Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5] | ||
src/sillycode.cpp:8: public: should be indented +1 space inside class Date [whitespace/indent] [3] | ||
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2] | ||
src/sillycode.cpp:15: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:39: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:40: Tab found; better to use spaces [whitespace/tab] [1] | ||
|
@@ -43,15 +42,11 @@ src/sillycode.cpp:110: Tab found; better to use spaces [whitespace/tab] [1] | |
src/sillycode.cpp:111: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:111: At least two spaces is best between code and comments [whitespace/comments] [2] | ||
src/sillycode.cpp:113: public: should be indented +1 space inside class Vector2 [whitespace/indent] [3] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:119: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:120: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:120: Missing space after , [whitespace/comma] [3] | ||
src/sillycode.cpp:122: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] | ||
src/sillycode.cpp:122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:124: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:125: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:125: At least two spaces is best between code and comments [whitespace/comments] [2] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ src/* | |
4 | ||
Done processing src/sillycode.cpp | ||
Done processing src/sillycode.w | ||
Total errors found: 126 | ||
Total errors found: 121 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we finding fewer expected errors? |
||
|
||
src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] | ||
src/sillycode.cpp:1: Include the directory when naming header files [build/include_subdir] [4] | ||
|
@@ -14,7 +14,6 @@ src/sillycode.cpp:3: Found C system header after other header. Should be: silly | |
src/sillycode.cpp:4: Found C system header after other header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] | ||
src/sillycode.cpp:5: Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5] | ||
src/sillycode.cpp:8: public: should be indented +1 space inside class Date [whitespace/indent] [3] | ||
src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector<string>& v [runtime/references] [2] | ||
src/sillycode.cpp:15: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:39: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:40: Tab found; better to use spaces [whitespace/tab] [1] | ||
|
@@ -44,15 +43,11 @@ src/sillycode.cpp:110: Tab found; better to use spaces [whitespace/tab] [1] | |
src/sillycode.cpp:111: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:111: At least two spaces is best between code and comments [whitespace/comments] [2] | ||
src/sillycode.cpp:113: public: should be indented +1 space inside class Vector2 [whitespace/indent] [3] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:119: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:120: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:120: Missing space after , [whitespace/comma] [3] | ||
src/sillycode.cpp:122: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] | ||
src/sillycode.cpp:122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] | ||
src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] | ||
src/sillycode.cpp:124: { should almost always be at the end of the previous line [whitespace/braces] [4] | ||
src/sillycode.cpp:125: Tab found; better to use spaces [whitespace/tab] [1] | ||
src/sillycode.cpp:125: At least two spaces is best between code and comments [whitespace/comments] [2] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we finding fewer expected errors?