Skip to content

test: stress PR for cpp-linter-action v2 (baseline) - #78

Open
shenxianpeng wants to merge 1 commit into
claude/project-thread-hdejwtfrom
e2e/stress-v2-43756669910
Open

shenxianpeng wants to merge 1 commit into
claude/project-thread-hdejwtfrom
e2e/stress-v2-43756669910

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Requested by Xianpeng · project thread

Temporary test PR, do not merge. Runs cpp-linter-action @v2 on 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 v3 PR opened from the same commit.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v21.1.8) reports: 3 file(s) not formatted
  • src/no_final_newline.cpp
  • stress/with space.cpp
  • stress/中文.cpp
clang-tidy (v21.1.8) reports: 9 concern(s)
  • src/no_final_newline.cpp:2:5: warning: [misc-use-internal-linkage]

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

        2 | int added(){
          |     ^
          | static 
  • src/no_final_newline.cpp:2:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        2 | int added(){
          | ~~~ ^      
          | auto        -> int
  • src/no_final_newline.cpp:3:3: warning: [misc-const-correctness]

    variable 'x' of type 'int' can be declared 'const'

        3 |   int   x=1;
          |   ^
          |         const 
  • src/no_final_newline.cpp:3:9: warning: [readability-identifier-length]

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

        3 |   int   x=1;
          |         ^
  • src/no_final_newline.cpp:4:3: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

        4 |   printf("%d",x);
          |   ^
  • stress/with space.cpp:6:7: warning: [misc-use-internal-linkage]

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

        6 | int   edited_space( ){return 1;}
          |       ^
          | static 
  • stress/with space.cpp:6:7: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        6 | int   edited_space( ){return 1;}
          | ~~~   ^              
          | auto                  -> int
  • stress/中文.cpp:6:7: warning: [misc-use-internal-linkage]

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

        6 | int   edited_cjk( ){return 2;}
          |       ^
          | static 
  • stress/中文.cpp:6:7: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        6 | int   edited_cjk( ){return 2;}
          | ~~~   ^            
          | auto                -> int

✨ 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

Used clang-tidy v21.1.8

Only 5 out of 6 clang-tidy concerns fit within this pull request's diff.

Click here for the full clang-tidy patch
diff --git a/src/no_final_newline.cpp b/src/no_final_newline.cpp
--- a/src/no_final_newline.cpp
+++ b/src/no_final_newline.cpp
@@ -2,2 +2,2 @@
-int added(){
-  int   x=1;
+static auto added() -> int {
+  int const x = 1;
@@ -5 +5,2 @@ int added(){
-  return x;}
\ No newline at end of file
+  return x;
+}
\ No newline at end of file
diff --git a/stress/with space.cpp b/stress/with space.cpp
--- a/stress/with space.cpp
+++ b/stress/with space.cpp
@@ -6 +6 @@ int main(){
-int   edited_space( ){return 1;}
+static auto edited_space() -> int { return 1; }
diff --git a/stress/中文.cpp b/stress/中文.cpp
--- a/stress/中文.cpp
+++ b/stress/中文.cpp
@@ -6 +6 @@ int main(){
-int   edited_cjk( ){return 2;}
+static auto edited_cjk() -> int { return 2; }

Used clang-format v21.1.8

Click here for the full clang-format patch
diff --git a/src/no_final_newline.cpp b/src/no_final_newline.cpp
--- a/src/no_final_newline.cpp
+++ b/src/no_final_newline.cpp
@@ -2,4 +2,5 @@
-int added(){
-  int   x=1;
-  printf("%d",x);
-  return x;}
\ No newline at end of file
+int added() {
+  int x = 1;
+  printf("%d", x);
+  return x;
+}
\ No newline at end of file
diff --git a/stress/with space.cpp b/stress/with space.cpp
--- a/stress/with space.cpp
+++ b/stress/with space.cpp
@@ -6 +6 @@ int main(){
-int   edited_space( ){return 1;}
+int edited_space() { return 1; }
diff --git a/stress/中文.cpp b/stress/中文.cpp
--- a/stress/中文.cpp
+++ b/stress/中文.cpp
@@ -6 +6 @@ int main(){
-int   edited_cjk( ){return 2;}
+int edited_cjk() { return 2; }

✨ Powered by cpp-linter -- ⭐ Star • ❤️ Sponsor • 💬 Feedback

Comment thread src/no_final_newline.cpp
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.

clang-format suggestion

Suggested change
int added(){
int x=1;
printf("%d",x);
return x;}
int added() {
int x = 1;
printf("%d", x);
return x;
}```
### clang-tidy diagnostic
**src/no_final_newline.cpp:3:9:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)]
> variable name 'x' is too short, expected at least 3 characters
```cpp
3 | int x=1;
| ^

clang-tidy diagnostic

src/no_final_newline.cpp:4:3: warning: [cppcoreguidelines-pro-type-vararg]

do not call c-style vararg functions

    4 |   printf("%d",x);
      |   ^

Comment thread stress/with space.cpp
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.

clang-format suggestion

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

clang-tidy diagnostics

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

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

clang-format suggestion

Suggested change
int edited_cjk( ){return 2;}
int edited_cjk() { return 2; }

clang-tidy diagnostics

Suggested change
int edited_cjk( ){return 2;}
static auto edited_cjk() -> int { return 2; }

Comment thread src/no_final_newline.cpp
Comment on lines +2 to +3
int added(){
int 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.

clang-tidy diagnostics

Suggested change
int added(){
int x=1;
static auto added() -> int {
int const x = 1;

Comment thread src/no_final_newline.cpp
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.

clang-tidy suggestion

Suggested change
return x;}
return x;
}```

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