cpp-linter / cpp-linter-action

A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of file-annotations, thread-comments, workflow step-summary, and Pull Request reviews.
https://cpp-linter.github.io/cpp-linter-action/
MIT License
91 stars 21 forks source link

reduce notifications by reducing invalid tests #219

Closed shenxianpeng closed 6 months ago

shenxianpeng commented 6 months ago

I think only these files and paths need to trigger a self test action. fixup #212

paths:
  - 'action.yml'
  - 'requirements.txt'
  - 'docs/examples/demo/**'
  - '.github/workflows/self-test.yml'
github-actions[bot] commented 6 months ago

Cpp-Linter Report :warning:

Some files did not pass the configured checks!

clang-format reports: 2 file(s) not formatted - docs/examples/demo/demo.cpp - docs/examples/demo/demo.hpp
clang-tidy reports: 7 concern(s) - **docs/examples/demo/demo.cpp:3:10:** warning: [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)] > inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead ```cpp #include ^~~~~~~~~ ``` - **docs/examples/demo/demo.cpp:8:5:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp int main(){ ~~~ ^ auto -> int ``` - **docs/examples/demo/demo.cpp:10:13:** warning: [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)] > statement should be inside braces ```cpp for (;;) break; ^ { ``` - **docs/examples/demo/demo.cpp:13:5:** warning: [[cppcoreguidelines-pro-type-vararg](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-vararg.html)] > do not call c-style vararg functions ```cpp printf("Hello world!\n"); ^ ``` - **docs/examples/demo/demo.hpp:6:11:** warning: [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)] > use default member initializer for 'useless' ```hpp char* useless; ^ {"\0"} ``` - **docs/examples/demo/demo.hpp:7:9:** warning: [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)] > use default member initializer for 'numb' ```hpp int numb; ^ {0} ``` - **docs/examples/demo/demo.hpp:11:11:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```hpp void *not_useful(char *str){useless = str;} ~~~~~~^ auto -> void * ```

Have any feedback or feature suggestions? Share it here.