Skip to content

test: end-to-end check of cpp-linter-action#501 with clang-tools 2.0.0 - #65

Closed
shenxianpeng wants to merge 3 commits into
masterfrom
claude/project-thread-nfsfml
Closed

shenxianpeng wants to merge 3 commits into
masterfrom
claude/project-thread-nfsfml

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Temporary PR, do not merge. It runs cpp-linter-action at cpp-linter/cpp-linter-action@fc065f1 (#501 head: cpp-linter 1.15.1, plus clang-tools 2.0.0) on a pull request, to check PR reviews, thread comments, annotations and auto-fix. It is not a draft because the action skips reviews on draft PRs. Close it after the test.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v20.1.2) reports: 1 file(s) not formatted
  • src/demo.cpp
clang-tidy (v20.1.2) reports: 20 concern(s)
  • src/demo.cpp:7:8: warning: [misc-use-internal-linkage]

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

        7 | size_t dummyFunc(size_t i) { return i; }
          |        ^
          | static 
  • src/demo.cpp:7:8: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        7 | size_t dummyFunc(size_t i) { return i; }
          | ~~~~~~ ^
          | auto                       -> size_t
  • src/demo.cpp:7:25: warning: [readability-identifier-length]

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

        7 | size_t dummyFunc(size_t i) { return i; }
          |                         ^
  • src/demo.cpp:9:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        9 | int main()
          | ~~~ ^     
          | auto       -> int
  • src/demo.cpp:11:13: warning: [readability-braces-around-statements]

    statement should be inside braces

       11 |     for (;;)
          |             ^
          |              {
       12 |         break;
          |               
  • src/demo.cpp:14:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       14 |     printf("Hello world!\n");
          |     ^
  • src/demo.cpp:20:5: warning: [misc-use-internal-linkage]

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

       20 | int addNumbers(int a, int b)
          |     ^
          | static 
  • src/demo.cpp:20:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       20 | int addNumbers(int a, int b)
          | ~~~ ^                       
          | auto                         -> int
  • src/demo.cpp:20:20: warning: [readability-identifier-length]

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

       20 | int addNumbers(int a, int b)
          |                    ^
  • src/demo.cpp:20:27: warning: [readability-identifier-length]

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

       20 | int addNumbers(int a, int b)
          |                           ^
  • src/demo.cpp:22:19: warning: [modernize-use-nullptr]

    use nullptr

       22 |     int* unused = NULL;
          |                   ^~~~
          |                   nullptr
  • src/demo.cpp:23:15: warning: [readability-braces-around-statements]

    statement should be inside braces

       23 |     if (a > b)
          |               ^
          |                {
       24 |         return a + b;
          |                      
  • src/demo.cpp:29:5: warning: [misc-use-internal-linkage]

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

       29 | int subtract(int x, int y) { return x - y; }
          |     ^
          | static 
  • src/demo.cpp:29:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       29 | int subtract(int x, int y) { return x - y; }
          | ~~~ ^
          | auto                       -> int
  • src/demo.cpp:29:18: warning: [readability-identifier-length]

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

       29 | int subtract(int x, int y) { return x - y; }
          |                  ^
  • src/demo.cpp:29:25: warning: [readability-identifier-length]

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

       29 | int subtract(int x, int y) { return x - y; }
          |                         ^
  • src/demo.cpp:32:7: warning: [misc-use-internal-linkage]

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

       32 | int   multiply( int x,int y ){return x*y;}
          |       ^
          | static 
  • src/demo.cpp:32:7: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       32 | int   multiply( int x,int y ){return x*y;}
          | ~~~   ^                      
          | auto                          -> int
  • src/demo.cpp:32:21: warning: [readability-identifier-length]

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

       32 | int   multiply( int x,int y ){return x*y;}
          |                     ^
  • src/demo.cpp:32:27: warning: [readability-identifier-length]

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

       32 | int   multiply( int x,int y ){return x*y;}
          |                           ^

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

@shenxianpeng
shenxianpeng marked this pull request as ready for review October 25, 2026 15:43

@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 v20.1.2

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

Click here for the full clang-tidy patch
diff --git a/src/demo.cpp b/src/demo.cpp
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -7 +7 @@
-size_t dummyFunc(size_t i) { return i; }
+static auto dummyFunc(size_t i) -> size_t { return i; }
@@ -9 +9 @@ size_t dummyFunc(size_t i) { return i; }
-int main()
+auto main() -> int
@@ -11 +11 @@ int main()
-    for (;;)
+    for (;;) {
@@ -12,0 +13 @@ int main()
+    }
@@ -20 +21 @@ int main()
-int addNumbers(int a, int b)
+static auto addNumbers(int a, int b) -> int
@@ -22,2 +23,2 @@ int addNumbers(int a, int b)
-    int* unused = NULL;
-    if (a > b)
+    int* unused = nullptr;
+    if (a > b) {
@@ -24,0 +26 @@ int addNumbers(int a, int b)
+    }
@@ -29 +31 @@ int addNumbers(int a, int b)
-int subtract(int x, int y) { return x - y; }
+static auto subtract(int x, int y) -> int { return x - y; }
@@ -32 +34 @@ int subtract(int x, int y) { return x - y; }
-int   multiply( int x,int y ){return x*y;}
+static auto multiply(int x, int y) -> int { return x * y; }

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/src/demo.cpp b/src/demo.cpp
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -32 +32 @@ int subtract(int x, int y) { return x - y; }
-int   multiply( int x,int y ){return x*y;}
+int multiply(int x, int y) { return x * y; }

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

Comment thread src/demo.cpp Outdated
int subtract(int x, int y) { return x - y; }

// round 2: badly formatted on purpose (temporary)
int multiply( int x,int y ){return x*y;}

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 multiply( int x,int y ){return x*y;}
int multiply(int x, int y) { return x * y; }

clang-tidy diagnostics

Suggested change
int multiply( int x,int y ){return x*y;}
static auto multiply(int x, int y) -> int { return x * y; }

Comment thread src/demo.cpp
#include <cstdio>

// using size_t from cstddef
size_t dummyFunc(size_t i) { return i; }

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
size_t dummyFunc(size_t i) { return i; }
static auto dummyFunc(size_t i) -> size_t { return i; }

Comment thread src/demo.cpp
}

// added to test cpp-linter-action#501 (temporary)
int addNumbers(int a, int b)

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 addNumbers(int a, int b)
static auto addNumbers(int a, int b) -> int

clang-tidy diagnostic

src/demo.cpp:20:20: warning: [readability-identifier-length]

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

   20 | int addNumbers(int a, int b)
      |                    ^

clang-tidy diagnostic

src/demo.cpp:20:27: warning: [readability-identifier-length]

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

   20 | int addNumbers(int a, int b)
      |                           ^

Comment thread src/demo.cpp
Comment on lines +22 to +23
int* unused = NULL;
if (a > b)

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* unused = NULL;
if (a > b)
int* unused = nullptr;
if (a > b) {

Comment thread src/demo.cpp
if (a > b)
return a + b;
return b + a;
}

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
}
}

Comment thread src/demo.cpp
}

// second round (temporary)
int subtract(int x, int y) { return x - y; }

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 subtract(int x, int y) { return x - y; }
static auto subtract(int x, int y) -> int { return x - y; }

clang-tidy diagnostic

src/demo.cpp:29:18: warning: [readability-identifier-length]

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

   29 | int subtract(int x, int y) { return x - y; }
      |                  ^

clang-tidy diagnostic

src/demo.cpp:29:25: warning: [readability-identifier-length]

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

   29 | int subtract(int x, int y) { return x - y; }
      |                         ^

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