Repository navigation
test: stress PR for cpp-linter-action v3.0.0-rc0 - #79
shenxianpeng wants to merge 1 commit into
Conversation
|
| Tool | Result |
|---|---|
| 3 files need formatting | |
| 9 warnings, 7 fixable |
clang-tidy: 9 warnings, 7 fixable
src/no_final_newline.cpp
| Line | Finding |
|---|---|
| 2 | function 'added' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable) misc-use-internal-linkage |
| 2 | use a trailing return type for this function (fixable) modernize-use-trailing-return-type |
| 3 | variable 'x' of type 'int' can be declared 'const' (fixable) misc-const-correctness |
| 3 | variable name 'x' is too short, expected at least 3 characters readability-identifier-length |
| 4 | do not call c-style vararg functions cppcoreguidelines-pro-type-vararg |
stress/with space.cpp
| Line | Finding |
|---|---|
| 6 | function 'edited_space' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable) misc-use-internal-linkage |
| 6 | use a trailing return type for this function (fixable) modernize-use-trailing-return-type |
stress/中文.cpp
| Line | Finding |
|---|---|
| 6 | function 'edited_cjk' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable) misc-use-internal-linkage |
| 6 | use a trailing return type for this function (fixable) modernize-use-trailing-return-type |
clang-format: 3 files
src/no_final_newline.cpp, lines 2-5stress/with space.cpp, line 6stress/中文.cpp, line 6
How to fix
From the repository root, format the listed lines with clang-format 21:
clang-format -i --style=llvm --lines=2:5 src/no_final_newline.cpp
clang-format -i --style=llvm --lines=6:6 'stress/with space.cpp'
clang-format -i --style=llvm --lines=6:6 'stress/中文.cpp'
Or apply every fix at once: this step's fix-patch-path output is a patch for git apply.
For the clang-tidy findings, give this to your coding agent:
Fix these clang-tidy findings:
- src/no_final_newline.cpp:2:5: warning: function 'added' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- src/no_final_newline.cpp:2:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
- src/no_final_newline.cpp:3:3: warning: variable 'x' of type 'int' can be declared 'const' [misc-const-correctness]
- src/no_final_newline.cpp:3:9: warning: variable name 'x' is too short, expected at least 3 characters [readability-identifier-length]
- src/no_final_newline.cpp:4:3: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
- stress/with space.cpp:6:7: warning: function 'edited_space' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- stress/with space.cpp:6:7: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
- stress/中文.cpp:6:7: warning: function 'edited_cjk' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- stress/中文.cpp:6:7: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
Powered by cpp-linter | Feedback
There was a problem hiding this comment.
cpp-linter review
3 comments (clang-format 21.1.8, clang-tidy 21.1.8)
Powered by cpp-linter | Feedback
| int added(){ | ||
| int x=1; | ||
| printf("%d",x); | ||
| return x;} No newline at end of file |
There was a problem hiding this comment.
Warning: misc-use-internal-linkage
function 'added' can be made static or moved into an anonymous namespace to enforce internal linkage
Warning: modernize-use-trailing-return-type
use a trailing return type for this function
Warning: misc-const-correctness
variable 'x' of type 'int' can be declared 'const'
| int added(){ | |
| int x=1; | |
| printf("%d",x); | |
| return x;} | |
| static auto added() -> int { | |
| int const x = 1; | |
| printf("%d", x); | |
| return x; | |
| } |
Warning: readability-identifier-length
variable name 'x' is too short, expected at least 3 characters
Warning: cppcoreguidelines-pro-type-vararg
do not call c-style vararg functions
| int main(){ | ||
| char* p = NULL; | ||
| printf("%d\n",f(3)); return 0;} | ||
| int edited_space( ){return 1;} |
There was a problem hiding this comment.
Warning: misc-use-internal-linkage
function 'edited_space' can be made static or moved into an anonymous namespace to enforce internal linkage
Warning: modernize-use-trailing-return-type
use a trailing return type for this function
| int edited_space( ){return 1;} | |
| static auto edited_space() -> int { return 1; } |
| int main(){ | ||
| char* p = NULL; | ||
| printf("%d\n",f(3)); return 0;} | ||
| int edited_cjk( ){return 2;} |
There was a problem hiding this comment.
Warning: misc-use-internal-linkage
function 'edited_cjk' can be made static or moved into an anonymous namespace to enforce internal linkage
Warning: modernize-use-trailing-return-type
use a trailing return type for this function
| int edited_cjk( ){return 2;} | |
| static auto edited_cjk() -> int { return 2; } |
Requested by Xianpeng · project thread
Temporary test PR, do not merge. Runs cpp-linter-action
@v3.0.0-rc0on a fixture with a pure rename, a mode-only change, a file without a final newline and edits to files with unusual names, to compare with the v2 PR opened from the same commit.