Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 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
14 changes: 13 additions & 1 deletion .github/workflows/cpp-lint-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ on:
description: 'which branch to test'
default: 'main'
required: true
pull_request:

jobs:
cpp-linter:
runs-on: windows-latest
permissions:
issues: write
pull-requests: write
contents: write

strategy:
matrix:
Expand All @@ -30,7 +35,11 @@ jobs:
python-version: 3.x

- name: Install workflow deps
run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}
# run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}
run: |
python -m pip install clang-tools
python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc8
# python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@main#subdirectory=py-binding

- name: Install clang-tools
run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm
Expand All @@ -55,6 +64,7 @@ jobs:
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CPP_LINTER_COLOR: true
run: >
cpp-linter
-s=file
Expand All @@ -66,6 +76,8 @@ jobs:
--extra-arg="-std=c++14 -Wall"
--thread-comments=${{ matrix.clang-version == '17' && 'update' }}
-a=${{ matrix.clang-version == '17' }}
--tidy-review=${{ matrix.clang-version == '17' }}
--format-review=${{ matrix.clang-version == '17' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
Expand Down
3 changes: 1 addition & 2 deletions src/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ size_t dummyFunc(size_t i) { return i; }

int main()

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
int main()
auto main() -> int

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
int main()
auto main() -> int

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
int main()
auto main() -> int

{
for (;;)
break;
for (;;) break;

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

clang-tidy diagnostic(s)

Suggested change
for (;;) break;
for (;;) {
break;
}

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

clang-tidy diagnostic(s)

Suggested change
for (;;) break;
for (;;) {
break;
}

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

clang-tidy diagnostic(s)

Suggested change
for (;;) break;
for (;;) {
break;
}

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

clang-tidy diagnostic(s)

Suggested change
for (;;) break;
for (;;) {
break;
}


printf("Hello world!\n");

Choose a reason for hiding this comment

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

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");
      |     ^

Choose a reason for hiding this comment

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

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");
      |     ^

Choose a reason for hiding this comment

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

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");
      |     ^


Expand Down
2 changes: 1 addition & 1 deletion src/demo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Dummy {
int numb;

public:
void *not_usefull(char *str){
void *not_useful(char *str){
Comment on lines 9 to +10

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
public:
void *not_usefull(char *str){
void *not_useful(char *str){
public:
void* not_useful(char* str)
{

Comment on lines 9 to +10

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
public:
void *not_usefull(char *str){
void *not_useful(char *str){
public:
void* not_useful(char* str)
{

Comment on lines 9 to +10

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
public:
void *not_usefull(char *str){
void *not_useful(char *str){
public:
void* not_useful(char* str)
{

useless = str;
return 0;
}
Comment on lines +10 to 13

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
void *not_useful(char *str){
useless = str;
return 0;
}
auto not_useful(char* str) -> void*
{
useless = str;
return nullptr;
}

Comment on lines +10 to 13

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
void *not_useful(char *str){
useless = str;
return 0;
}
auto not_useful(char* str) -> void*
{
useless = str;
return nullptr;
}

Comment on lines +10 to 13

Choose a reason for hiding this comment

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

clang-tidy diagnostic(s)

Suggested change
void *not_useful(char *str){
useless = str;
return 0;
}
auto not_useful(char* str) -> void*
{
useless = str;
return nullptr;
}

Comment on lines +10 to 13

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

clang-tidy diagnostic(s)

Suggested change
void *not_useful(char *str){
useless = str;
return 0;
}
auto not_useful(char* str) -> void*
{
useless = str;
return 0;
}

Expand Down