-
Notifications
You must be signed in to change notification settings - Fork 1
Test pr review refactor #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cpp-Linter Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cpp-linter Review
Click here for the full clang-tidy patch
diff --git a/src/demo.cpp b/src/demo.cpp
index 18d07bf..9e30a45 100644
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -9 +9 @@ size_t dummyFunc(size_t i) { return i; }
-int main()
+auto main() -> int
@@ -11 +11,3 @@ int main()
- for (;;) break;
+ for (;;) {
+ break;
+ }
diff --git a/src/demo.hpp b/src/demo.hpp
index 2972211..4a96fbd 100644
--- a/src/demo.hpp
+++ b/src/demo.hpp
@@ -10,4 +10,5 @@ class Dummy {
- void *not_useful(char *str){
- useless = str;
- return 0;
- }
+ auto not_useful(char* str) -> void*
+ {
+ useless = str;
+ return nullptr;
+ }
Only 4 out of 5 clang-format concerns fit within this pull request's diff.
Click here for the full clang-format patch
diff --git a/src/demo.cpp b/src/demo.cpp
index 18d07bf..0c1db60 100644
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -11 +11,2 @@ int main()
- for (;;) break;
+ for (;;)
+ break;
@@ -13 +14 @@ int main()
- printf( "Hello world!\n");
+ printf("Hello world!\n");
@@ -15 +16,2 @@ int main()
- return 0;}
+ return 0;
+}
diff --git a/src/demo.hpp b/src/demo.hpp
index 2972211..645a50f 100644
--- a/src/demo.hpp
+++ b/src/demo.hpp
@@ -9,2 +9,3 @@ class Dummy {
- public:
- void *not_useful(char *str){
+public:
+ void* not_useful(char* str)
+ {
@@ -16,23 +17 @@ class Dummy {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-struct LongDiff
-{
+struct LongDiff {
Have any feedback or feature suggestions? Share it here.
|
||
int main() | ||
{ | ||
for (;;) | ||
break; | ||
for (;;) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format suggestion
for (;;) break; | |
for (;;) | |
break; |
clang-tidy diagnostics
- statement should be inside braces [readability-braces-around-statements]
for (;;) break; | |
for (;;) { | |
break; | |
} |
|
||
printf("Hello world!\n"); | ||
printf( "Hello world!\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format suggestion
printf( "Hello world!\n"); | |
printf("Hello world!\n"); |
clang-tidy diagnostic
src/demo.cpp:13:5: warning: [cppcoreguidelines-pro-type-vararg]
do not call c-style vararg functions
13 | printf( "Hello world!\n");
| ^
|
||
return 0; | ||
} | ||
return 0;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format suggestion
return 0;} | |
return 0; | |
} |
public: | ||
void *not_usefull(char *str){ | ||
void *not_useful(char *str){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format suggestion
public: | |
void *not_usefull(char *str){ | |
void *not_useful(char *str){ | |
public: | |
void* not_useful(char* str) | |
{ |
@@ -6,12 +6,10 @@ | |||
// using size_t from cstddef | |||
size_t dummyFunc(size_t i) { return i; } | |||
|
|||
int main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy diagnostics
- use a trailing return type for this function [modernize-use-trailing-return-type]
int main() | |
auto main() -> int |
void *not_useful(char *str){ | ||
useless = str; | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy diagnostics
- use a trailing return type for this function [modernize-use-trailing-return-type]
- use nullptr [modernize-use-nullptr]
void *not_useful(char *str){ | |
useless = str; | |
return 0; | |
} | |
auto not_useful(char* str) -> void* | |
{ | |
useless = str; | |
return nullptr; | |
} |
4a861e3
to
4065be2
Compare
turn on debugging output test refactor-pr-reviews branch
455910a
to
19c9a13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cpp-linter Review
Click here for the full clang-tidy patch
diff --git a/src/demo.cpp b/src/demo.cpp
index 18d07bf..9e30a45 100644
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -9 +9 @@ size_t dummyFunc(size_t i) { return i; }
-int main()
+auto main() -> int
@@ -11 +11,3 @@ int main()
- for (;;) break;
+ for (;;) {
+ break;
+ }
diff --git a/src/demo.hpp b/src/demo.hpp
index 2972211..4a96fbd 100644
--- a/src/demo.hpp
+++ b/src/demo.hpp
@@ -10,4 +10,5 @@ class Dummy {
- void *not_useful(char *str){
- useless = str;
- return 0;
- }
+ auto not_useful(char* str) -> void*
+ {
+ useless = str;
+ return nullptr;
+ }
Click here for the full clang-format patch
diff --git a/src/demo.cpp b/src/demo.cpp
index 18d07bf..0c1db60 100644
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -11 +11,2 @@ int main()
- for (;;) break;
+ for (;;)
+ break;
@@ -13 +14 @@ int main()
- printf( "Hello world!\n");
+ printf("Hello world!\n");
@@ -15 +16,2 @@ int main()
- return 0;}
+ return 0;
+}
diff --git a/src/demo.hpp b/src/demo.hpp
index 2972211..645a50f 100644
--- a/src/demo.hpp
+++ b/src/demo.hpp
@@ -9,2 +9,3 @@ class Dummy {
- public:
- void *not_useful(char *str){
+public:
+ void* not_useful(char* str)
+ {
@@ -16,23 +17 @@ class Dummy {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-struct LongDiff
-{
+struct LongDiff {
Have any feedback or feature suggestions? Share it here.
testing cpp-linter/cpp-linter#117