Skip to content

Test pr reviews (attempt 2) #27

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/cpp-lint-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
description: 'which branch to test'
default: 'main'
required: true
pull_request:

jobs:
cpp-linter:
runs-on: windows-latest

strategy:
matrix:
clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17']
clang-version: ['10', '11', '12', '13', '14', '15', '16', '17']
repo: ['cpp-linter/cpp-linter']
branch: ['${{ inputs.branch }}']
branch: ['pr-review-suggestions']
fail-fast: false

steps:
Expand Down Expand Up @@ -62,10 +63,12 @@ jobs:
-i=build
-p=build
-V=${{ runner.temp }}/llvm
-f=false
--extra-arg="-std=c++14 -Wall"
--thread-comments=${{ matrix.clang-version == '12' }}
-a=${{ matrix.clang-version == '12' }}
--file-annotations=false
--lines-changed-only=false
--thread-comments=${{ matrix.clang-version == '16' }}
--tidy-review=${{ matrix.clang-version == '16' }}
--format-review=${{ matrix.clang-version == '16' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
Expand Down
21 changes: 11 additions & 10 deletions src/demo.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/** This is a very ugly test code (doomed to fail linting) */
#include "demo.hpp"
#include <cstdio>
#include <cstddef>
#include <stdio.h>
Copy link

@github-actions github-actions bot Jan 8, 2024

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
#include <stdio.h>
#include <cstdio>


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

Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Suggested change
int main()
{

Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy suggestions

Suggested change
auto main() -> int
{

int main()
{
for (;;)
break;


int main(){

for (;;) break;

Comment on lines +6 to +11
Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Suggested change
int main(){
for (;;) break;
for (;;)
break;

Comment on lines +6 to +11
Copy link

@github-actions github-actions bot Jan 8, 2024

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 main(){
for (;;) break;
for (;;) {
break;
}


printf("Hello world!\n");
Comment on lines 4 to 13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Suggested change
// using size_t from cstddef
size_t dummyFunc(size_t i) { return i; }
int main()
{
for (;;)
break;
int main(){
for (;;) break;
printf("Hello world!\n");
int main()
{
for (;;)
break;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The printf()seems to be getting dropped in this suggestion.

Comment on lines 2 to 13
Copy link

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
#include "demo.hpp"
#include <cstdio>
#include <cstddef>
#include <stdio.h>
// using size_t from cstddef
size_t dummyFunc(size_t i) { return i; }
int main()
{
for (;;)
break;
int main(){
for (;;) break;
printf("Hello world!\n");
#include "demo.hpp"
#include <cstdio>
auto main() -> int
{
for (;;) {
break;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, the printf() call is getting dropped in this suggestion.


return 0;
}



return 0;}
Comment on lines +15 to +18
Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Suggested change
return 0;}
return 0;
}

Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy suggestions

Suggested change
return 0;}
return 0;
}

11 changes: 3 additions & 8 deletions src/demo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
class Dummy {
char* useless;
int numb;
Dummy() :numb(0), useless("\0"){}
Comment on lines 6 to +8
Copy link

@github-actions github-actions bot Jan 8, 2024

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
char* useless;
int numb;
Dummy() :numb(0), useless("\0"){}
char* useless { "\0" };
int numb { 0 };
Dummy() { }


public:
void *not_usefull(char *str){
useless = str;
return 0;
}
void *not_useful(char *str){useless = str;}
Comment on lines +8 to +11
Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Suggested change
Dummy() :numb(0), useless("\0"){}
public:
void *not_usefull(char *str){
useless = str;
return 0;
}
void *not_useful(char *str){useless = str;}
Dummy()
: numb(0)
, useless("\0")
{
}
public:
void* not_useful(char* str) { useless = str; }

Comment on lines 10 to +11
Copy link

@github-actions github-actions bot Jan 8, 2024

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
public:
void *not_usefull(char *str){
useless = str;
return 0;
}
void *not_useful(char *str){useless = str;}
public:
auto not_useful(char* str) -> void* { useless = str; }

};

Comment on lines 10 to 13
Copy link

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
public:
void *not_usefull(char *str){
useless = str;
return 0;
}
void *not_useful(char *str){useless = str;}
};
public:
auto not_useful(char* str) -> void* { useless = str; }
};


Expand All @@ -28,14 +26,11 @@ class Dummy {









struct LongDiff
{

long diff;

Copy link

@github-actions github-actions bot Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestions

Please remove the line(s)

  • 35

};