Skip to content

test: rc.28 e2e (old action) - #88

Open
shenxianpeng wants to merge 2 commits into
claude/project-thread-u751ea-rc28from
e2e/rc28-old-45502372855
Open

shenxianpeng wants to merge 2 commits into
claude/project-thread-u751ea-rc28from
e2e/rc28-old-45502372855

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

Temporary PR for the cpp-linter-rs rc.28 end-to-end test (old action). Do not merge.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ cpp-linter review

7 comments (clang-format 21.1.8, clang-tidy 21.1.8)

Some findings could not be posted as suggestions:

  • stress/latin1.cpp: 1 fix is only in the patch file because the file is not UTF-8 encoded

Powered by cpp-linter | Feedback

Comment thread -top.cpp Outdated
@@ -0,0 +1 @@
int top_dash( ){return 1;}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Warning: misc-use-internal-linkage

function 'top_dash' 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

Suggested change
int top_dash( ){return 1;}
static auto top_dash() -> int { return 1; }

Comment thread cap/many.cpp Outdated
total += 14;
return total;
}
// touched

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggests this formatting.

Suggested change
// touched
// touched

Comment thread src/fixits.cpp Outdated
Comment on lines +1 to +2
int fixits(int x, int *p) {
if (p == 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Warning: misc-use-internal-linkage

function 'fixits' 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: readability-non-const-parameter

pointer parameter 'p' can be pointer to const

⚠ Warning: modernize-use-nullptr

use nullptr

⚠ Warning: readability-braces-around-statements

statement should be inside braces

Suggested change
int fixits(int x, int *p) {
if (p == 0)
static auto fixits(int x, const int *p) -> int {
if (p == nullptr) {

⚠ Warning: readability-identifier-length

parameter name 'x' is too short, expected at least 3 characters

⚠ Warning: readability-identifier-length

parameter name 'p' is too short, expected at least 3 characters

Comment thread src/fixits.cpp Outdated
int fixits(int x, int *p) {
if (p == 0)
return 0;
if (x > 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Warning: readability-braces-around-statements

statement should be inside braces

Suggested change
if (x > 1)
}
if (x > 1) {

Comment thread src/fixits.cpp Outdated
Comment on lines +6 to +7
else
return 2;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ Warning: readability-braces-around-statements

statement should be inside braces

⚠ Warning: readability-else-after-return

do not use 'else' after 'return'

Suggested change
else
return 2;
}
return 2;

⚠ Warning: readability-braces-around-statements

statement should be inside braces

Comment thread src/no_final_newline.cpp Outdated
Comment on lines +2 to +5
int added(){
int x=1;
printf("%d",x);
return x;} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ 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'

Suggested change
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

Comment thread stress/with space.cpp Outdated
int main(){
char* p = NULL;
printf("%d\n",f(3)); return 0;}
int edited_space( ){return 1;}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠ 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

Suggested change
int edited_space( ){return 1;}
static auto edited_space() -> int { return 1; }

@github-actions

Copy link
Copy Markdown

⚠ cpp-linter found 26 issues in 6 files

Tool Result
⚠ clang-format 21.1.8 5 files need formatting
⚠ clang-tidy 21.1.8 21 warnings, 16 fixable
clang-tidy: 21 warnings, 16 fixable

-top.cpp

Line Finding
1 function 'top_dash' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable)
misc-use-internal-linkage
1 use a trailing return type for this function (fixable)
modernize-use-trailing-return-type

src/fixits.cpp

Line Finding
1 function 'fixits' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable)
misc-use-internal-linkage
1 use a trailing return type for this function (fixable)
modernize-use-trailing-return-type
1 parameter name 'x' is too short, expected at least 3 characters
readability-identifier-length
1 parameter name 'p' is too short, expected at least 3 characters
readability-identifier-length
1 pointer parameter 'p' can be pointer to const (fixable)
readability-non-const-parameter
2 use nullptr (fixable)
modernize-use-nullptr
2 statement should be inside braces (fixable)
readability-braces-around-statements
4 statement should be inside braces (fixable)
readability-braces-around-statements
6 do not use 'else' after 'return' (fixable)
readability-else-after-return
6 statement should be inside braces
readability-braces-around-statements

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/latin1.cpp

Line Finding
7 function 'edited_latin1' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable)
misc-use-internal-linkage
7 use a trailing return type for this function (fixable)
modernize-use-trailing-return-type

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
clang-format: 5 files
  • -top.cpp, line 1
  • cap/many.cpp, line 36
  • src/no_final_newline.cpp, lines 2-5
  • stress/latin1.cpp, line 7
  • stress/with space.cpp, line 6
How to fix

From the repository root, format the listed lines with clang-format 21:

clang-format -i --style=llvm --lines=1:1 -top.cpp
clang-format -i --style=llvm --lines=36:36 cap/many.cpp
clang-format -i --style=llvm --lines=2:5 src/no_final_newline.cpp
clang-format -i --style=llvm --lines=7:7 stress/latin1.cpp
clang-format -i --style=llvm --lines=6:6 'stress/with space.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:
- -top.cpp:1:7: warning: function 'top_dash' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- -top.cpp:1:7: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
- src/fixits.cpp:1:5: warning: function 'fixits' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- src/fixits.cpp:1:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
- src/fixits.cpp:1:16: warning: parameter name 'x' is too short, expected at least 3 characters [readability-identifier-length]
- src/fixits.cpp:1:24: warning: parameter name 'p' is too short, expected at least 3 characters [readability-identifier-length]
- src/fixits.cpp:1:24: warning: pointer parameter 'p' can be pointer to const [readability-non-const-parameter]
- src/fixits.cpp:2:12: warning: use nullptr [modernize-use-nullptr]
- src/fixits.cpp:2:14: warning: statement should be inside braces [readability-braces-around-statements]
- src/fixits.cpp:4:13: warning: statement should be inside braces [readability-braces-around-statements]
- src/fixits.cpp:6:3: warning: do not use 'else' after 'return' [readability-else-after-return]
- src/fixits.cpp:6:7: warning: statement should be inside braces [readability-braces-around-statements]
- 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/latin1.cpp:7:7: warning: function 'edited_latin1' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- stress/latin1.cpp:7:7: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
- 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]

Powered by cpp-linter | Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant