Skip to content

test: rc.29 e2e (new: cpp-linter 2.0.0rc29) - #89

Open
shenxianpeng wants to merge 2 commits into
claude/project-thread-eigt2ffrom
e2e/rc29-new-46181741997
Open

shenxianpeng wants to merge 2 commits into
claude/project-thread-eigt2ffrom
e2e/rc29-new-46181741997

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Requested by Xianpeng · project thread

Temporary pre-release test PR for cpp-linter-rs v2.0.0-rc.29 with action v3 (PR #543 head). Do not merge; close after the test.

@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 23.1.6, clang-tidy 23.1.6)

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

Suggested change
int top_dash( ){return 1;}
static int top_dash() { 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 incdemo/use2.cpp Outdated
@@ -0,0 +1,2 @@
#include "missing_lib.h"
int use_two(){return lib_value();}

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 'use_two' can be made static or moved into an anonymous namespace to enforce internal linkage

Suggested change
int use_two(){return lib_value();}
static int use_two() { return lib_value(); }

Comment thread incdemo/use2.cpp
@@ -0,0 +1,2 @@
#include "missing_lib.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✖ Error: clang-diagnostic-error

'missing_lib.h' file not found

Comment thread src/fixits.cpp Outdated
Comment on lines +1 to +7
int fixits(int x, int *p) {
if (p == 0)
return 0;
if (x > 1)
return 1;
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: misc-use-internal-linkage

function 'fixits' can be made static or moved into an anonymous namespace to enforce internal linkage

⚠ Warning: misc-const-correctness

pointee of variable 'p' of type 'int *' can be declared 'const'

⚠ Warning: readability-non-const-parameter

pointer parameter 'p' can be pointer to const

⚠ Warning: readability-braces-around-statements

statement should be inside braces

⚠ Warning: readability-braces-around-statements

statement should be inside braces

⚠ Warning: readability-else-after-return

do not use 'else' after 'return'

⚠ Warning: readability-braces-around-statements

statement should be inside braces

Suggested change
int fixits(int x, int *p) {
if (p == 0)
return 0;
if (x > 1)
return 1;
else
return 2;
static int fixits(int x, const int const* p)
{
if (p == 0) {
return 0;
}
if (x > 1) {
return 1;
}
{
return 2;
}

⚠ 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/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: 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 int added()
{
int const x = 1;
printf("%d", x);
return x;
}

⚠ Warning: readability-identifier-length

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

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

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

@github-actions

Copy link
Copy Markdown

✖ cpp-linter found 24 issues in 7 files

Tool Result
⚠ clang-format 23.1.6 7 files need formatting
✖ clang-tidy 23.1.6 1 error, 16 warnings, 13 fixable

clang-tidy could not find 1 included file, so it likely does not know how this code is built, and its other findings may be wrong too. Generate a compilation database (with CMake: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON) and pass its folder as the database option.

clang-tidy: 1 error, 16 warnings, 13 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

incdemo/use2.cpp

Line Finding
1 error: 'missing_lib.h' file not found
clang-diagnostic-error
2 function 'use_two' can be made static or moved into an anonymous namespace to enforce internal linkage (fixable)
misc-use-internal-linkage

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 parameter name 'x' is too short, expected at least 3 characters
readability-identifier-length
1 pointee of variable 'p' of type 'int *' can be declared 'const' (fixable)
misc-const-correctness
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 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 (fixable)
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
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

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

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
clang-format: 7 files
  • -top.cpp, line 1
  • cap/many.cpp, line 36
  • incdemo/use2.cpp, line 2
  • src/fixits.cpp, lines 1-7
  • 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 23:

clang-format -i --style=file --lines=1:1 ./-top.cpp
clang-format -i --style=file --lines=36:36 cap/many.cpp
clang-format -i --style=file --lines=2:2 incdemo/use2.cpp
clang-format -i --style=file --lines=1:7 src/fixits.cpp
clang-format -i --style=file --lines=2:5 src/no_final_newline.cpp
clang-format -i --style=file --lines=7:7 stress/latin1.cpp
clang-format -i --style=file --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]
- incdemo/use2.cpp:1:10: error: 'missing_lib.h' file not found [clang-diagnostic-error]
- incdemo/use2.cpp:2:5: warning: function 'use_two' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- 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:16: warning: parameter name 'x' is too short, expected at least 3 characters [readability-identifier-length]
- src/fixits.cpp:1:19: warning: pointee of variable 'p' of type 'int *' can be declared 'const' [misc-const-correctness]
- 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: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: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]
- 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/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]

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