Skip to content

Commit

Permalink
update cpp-linter dependency to v1.6.2 (#169)
Browse files Browse the repository at this point in the history
resolves #168

adds 2 new output variables:
- clang-tidy-checks-failed
- clang-format-checks-failed
  • Loading branch information
2bndy5 committed Dec 5, 2023
1 parent 37462e1 commit e163f22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,19 @@ jobs:

### Outputs

This action creates 1 output variable named `checks-failed`. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's output to exit the workflow early if that is desired.
This action creates 3 output variables. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's outputs to exit the workflow early if that is desired.

#### `checks-failed`

The total number of concerns raised by both clang-format and clang-tidy.

#### `clang-tidy-checks-failed`

The total number of concerns raised by clang-tidy only.

#### `clang-format-checks-failed`

The total number of concerns raised by clang-format only.

## Example

Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,14 @@ inputs:
default: ""
outputs:
checks-failed:
description: An integer that can be used as a boolean value to indicate if all checks failed.
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy and clang-format.
value: ${{ steps.cpp-linter.outputs.checks-failed }}
clang-tidy-checks-failed:
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy only.
value: ${{ steps.cpp-linter.outputs.clang-tidy-checks-failed }}
clang-format-checks-failed:
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-format only.
value: ${{ steps.cpp-linter.outputs.clang-format-checks-failed }}
runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ clang-tools==0.9.0

# cpp-linter core Python executable package
# For details please see: https://github.com/cpp-linter/cpp-linter
cpp-linter==1.6.1
cpp-linter==1.6.2

1 comment on commit e163f22

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 2 file(s) not formatted
  • src/demo.cpp
  • src/demo.hpp
clang-tidy reports: 7 concern(s)
  • src/demo.cpp

    C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.38.33130/include/yvals_core.h:887:1: error: [clang-diagnostic-error]

    static_assert failed "Error in C++ Standard Library usage."

    _EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 16.0.0 or newer.");
    ^
    C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.38.33130\include\yvals_core.h:514:5: note: expanded from macro '_EMIT_STL_ERROR'
        static_assert(false, "Error in C++ Standard Library usage.")
        ^

    /src/demo.cpp:7:8: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    size_t dummyFunc(size_t i) { return i; }
    ~~~~~~ ^
    auto                       -> size_t

    /src/demo.cpp:9:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int main()
    ~~~ ^
    auto       -> int

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

    statement should be inside braces

        for (;;)
                ^
                 {

    /src/demo.cpp:14:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

        printf("Hello world!\n");
        ^
  • src/demo.hpp

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

    use a trailing return type for this function

        void *not_usefull(char *str){
        ~~~~~~^
        auto                         -> void *

    /src/demo.hpp:12:16: warning: [modernize-use-nullptr]

    use nullptr

            return 0;
                   ^
                   nullptr

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.