Skip to content

Commit

Permalink
trigger workflow on push
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Oct 27, 2023
1 parent 61876cc commit 13d2271
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/cpp-lint-package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: cpp-linter as pkg

on:
workflow_dispatch:
inputs:
branch:
description: 'which branch to test'
default: 'main'
required: true
# workflow_dispatch:
# inputs:
# branch:
# description: 'which branch to test'
# default: 'main'
# required: true
push:

jobs:
cpp-linter:
Expand All @@ -16,7 +17,7 @@ jobs:
matrix:
clang-version: ['7', '8', '9','10', '11', '12', '13', '14']
repo: ['cpp-linter/cpp-linter']
branch: ['${{ inputs.branch }}']
branch: ['resolve-34'] # ['${{ inputs.branch }}']
fail-fast: false

steps:
Expand Down Expand Up @@ -49,18 +50,6 @@ jobs:
if: steps.cache-build.outputs.cache-hit != 'true'
run: mkdir build && cmake -Bbuild src -G "NMake Makefiles"

- name: Update comments?
id: linter-thread-comments
shell: python
run: |
import os
with open(os.environ["GITHUB_OUTPUT"], 'a') as gh_out:
if ${{ matrix.clang-version }} == 12:
gh_out.write('thread-comment=update\n')
elif ${{ matrix.clang-version }} == 13:
gh_out.write('thread-comment=true\n')
else:
gh_out.write('thread-comment=false\n')
- name: Run linter as package
id: linter
env:
Expand All @@ -74,7 +63,7 @@ jobs:
-V=${{ runner.temp }}/llvm
-f=false
--extra-arg="-std=c++14 -Wall"
--thread-comments=${{ steps.linter-thread-comments.outputs.thread-comment }}
--thread-comments=update
-a=${{ matrix.clang-version == '12' }}
--no-lgtm=false
Expand Down

1 comment on commit 13d2271

@github-actions
Copy link

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: 8 concern(s)
  • src/demo.cpp

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

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

    _EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 15.0.0 or newer.");
    ^
    C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include\yvals_core.h:462: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:7:25: warning: [readability-identifier-length]

    parameter name 'i' is too short, expected at least 3 characters

    size_t dummyFunc(size_t i) { return i; }
                            ^

    /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.