Skip to content

test: rc.29 e2e (old: cpp-linter 2.0.0rc27) - #90

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

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

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Requested by Xianpeng · project thread

Temporary pre-release test PR: the same fixture with action v3 (PR #543 head) unchanged (cpp-linter 2.0.0rc27 = rs rc.28), for comparison. 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

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✖ cpp-linter found 10 issues in 6 files

Tool Result
✔ clang-format 23.1.7 all files formatted
✖ clang-tidy 23.1.7 1 error, 9 warnings
clang-tidy: 1 error, 9 warnings

-top.cpp

Line Finding
1 function 'top_dash' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace

incdemo/use2.cpp

Line Finding
1 error: 'missing_lib.h' file not found
clang-diagnostic-error
2 function 'use_two' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace

src/fixits.cpp

Line Finding
1 function 'fixits' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace
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

src/no_final_newline.cpp

Line Finding
2 function 'added' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace
4 variable name 'x' is too short, expected at least 3 characters
readability-identifier-length

stress/latin1.cpp

Line Finding
7 function 'edited_latin1' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace

stress/with space.cpp

Line Finding
6 function 'edited_space' declared 'static', move to anonymous namespace instead
misc-use-anonymous-namespace
How to fix

For the clang-tidy findings, give this to your coding agent:

Fix these clang-tidy findings:
- -top.cpp:1:12: warning: function 'top_dash' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
- incdemo/use2.cpp:1:10: error: 'missing_lib.h' file not found [clang-diagnostic-error]
- incdemo/use2.cpp:2:12: warning: function 'use_two' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
- src/fixits.cpp:1:12: warning: function 'fixits' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
- src/fixits.cpp:1:23: warning: parameter name 'x' is too short, expected at least 3 characters [readability-identifier-length]
- src/fixits.cpp:1:43: warning: parameter name 'p' is too short, expected at least 3 characters [readability-identifier-length]
- src/no_final_newline.cpp:2:12: warning: function 'added' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
- src/no_final_newline.cpp:4:15: warning: variable name 'x' is too short, expected at least 3 characters [readability-identifier-length]
- stress/latin1.cpp:7:12: warning: function 'edited_latin1' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
- stress/with space.cpp:6:12: warning: function 'edited_space' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]

Powered by cpp-linter | Feedback

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

1 comment was already posted in a previous review.

Powered by cpp-linter | Feedback

Comment thread -top.cpp
@@ -0,0 +1 @@
static 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-anonymous-namespace

function 'top_dash' declared 'static', move to anonymous namespace instead

Comment thread incdemo/use2.cpp
@@ -0,0 +1,2 @@
#include "missing_lib.h"
static 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-anonymous-namespace

function 'use_two' declared 'static', move to anonymous namespace instead

Comment thread src/fixits.cpp
@@ -0,0 +1,12 @@
static int fixits(int x, const int const* p)

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-anonymous-namespace

function 'fixits' declared 'static', move to anonymous namespace instead

⚠ 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
@@ -0,0 +1,7 @@
#include <cstdio>
static int added()

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-anonymous-namespace

function 'added' declared 'static', move to anonymous namespace instead

Comment thread src/no_final_newline.cpp
#include <cstdio>
static int added()
{
int const 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-identifier-length

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

Comment thread stress/latin1.cpp
int main(){
char* p = NULL;
printf("%d\n",f(3)); return 0;}
static int edited_latin1() { return 3; }

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-anonymous-namespace

function 'edited_latin1' declared 'static', move to anonymous namespace instead

Comment thread stress/with space.cpp
int main(){
char* p = NULL;
printf("%d\n",f(3)); return 0;}
static 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-anonymous-namespace

function 'edited_space' declared 'static', move to anonymous namespace instead

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