Repository navigation
test: trial run of the e2e workflow (do not merge) - #71
shenxianpeng wants to merge 3 commits into
Conversation
"Run workflow" opens a PR with known lint problems, runs the chosen cpp-linter-action ref on it on 3 operating systems, checks the thread comment, review, annotations and outputs, and reports the result.
Cpp-Linter Report
|
There was a problem hiding this comment.
Cpp-linter Review
Used clang-tidy v21.1.8
Only 3 out of 4 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
@@ -9 +9 @@ size_t dummyFunc(size_t i) { return i; }
-int scale(int value)
+static auto scale(int value) -> int
@@ -11,2 +11,3 @@ int scale(int value)
- if (value > 0)
- return value*3;
+ if (value > 0) {
+ return value * 3;
+ }
Used clang-format v21.1.8
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
@@ -12 +12 @@ int scale(int value)
- return value*3;
+ return value * 3;
@@ -21 +21 @@ int main()
- printf("Hello world! %d\n", scale( 14 ));
+ printf("Hello world! %d\n", scale(14));
✨ Powered by cpp-linter -- ⭐ Star • ❤️ Sponsor • 💬 Feedback
| int scale(int value) | ||
| { | ||
| if (value > 0) | ||
| return value*3; |
There was a problem hiding this comment.
clang-format suggestion
| return value*3; | |
| return value * 3; |
| break; | ||
|
|
||
| printf("Hello world!\n"); | ||
| printf("Hello world! %d\n", scale( 14 )); |
There was a problem hiding this comment.
clang-format suggestion
| printf("Hello world! %d\n", scale( 14 )); | |
| printf("Hello world! %d\n", scale(14)); |
clang-tidy diagnostic
src/demo.cpp:21:5: warning: [cppcoreguidelines-pro-type-vararg]
do not call c-style vararg functions
21 | printf("Hello world! %d\n", scale( 14 ));
| ^clang-tidy diagnostic
src/demo.cpp:21:40: warning: [cppcoreguidelines-avoid-magic-numbers]
14 is a magic number; consider replacing it with a named constant
21 | printf("Hello world! %d\n", scale( 14 ));
| ^| // using size_t from cstddef | ||
| size_t dummyFunc(size_t i) { return i; } | ||
|
|
||
| int scale(int value) |
There was a problem hiding this comment.
clang-tidy diagnostics
- function 'scale' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
- use a trailing return type for this function [modernize-use-trailing-return-type]
| int scale(int value) | |
| static auto scale(int value) -> int |
| if (value > 0) | ||
| return value*3; |
There was a problem hiding this comment.
clang-tidy diagnostics
- statement should be inside braces [readability-braces-around-statements]
| if (value > 0) | |
| return value*3; | |
| if (value > 0) { | |
| return value * 3; | |
| } |
e2e result: passedcpp-linter-action
|
Temporary PR to try the new
e2e on a real PRworkflow againstcpp-linter-action@main. Do not merge. The workflow closes it when all checks pass.