Skip to content
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

prepare for rust pkg tests #42

Closed
wants to merge 11 commits into from
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
@@ -1,4 +1,4 @@
/** This is a very ugly test code (doomed to fail linting) */

Check notice on line 1 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (17, cpp-linter/cpp-linter)

Run clang-format on src/demo.cpp

File src/demo.cpp does not conform to Custom style guidelines. (lines 11)
#include "demo.hpp"
#include <cstdio>
#include <cstddef>
Expand All @@ -8,8 +8,7 @@

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;

Check warning on line 11 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (17, cpp-linter/cpp-linter)

src/demo.cpp:11:13 [readability-braces-around-statements]

statement should be inside braces

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
@@ -1,4 +1,4 @@
#pragma once

Check notice on line 1 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (17, cpp-linter/cpp-linter)

Run clang-format on src/demo.hpp

File src/demo.hpp does not conform to Custom style guidelines. (lines 10)



Expand All @@ -7,7 +7,7 @@
int numb;

public:
void *not_usefull(char *str){
void *not_useful(char *str){

Check warning on line 10 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (17, cpp-linter/cpp-linter)

src/demo.hpp:10:11 [modernize-use-trailing-return-type]

use a trailing return type for this function
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