Search code examples
c++githubgithub-actionslinter

cpplinter in github actions


I want to install auto-checking my code with help of cpplint in Github actions.

I try to install it in workflows file like that:

- name: Install cpplint
      working-directory: ${{runner.workspace}}/uast      
      shell: bash         
      run: |         
          pip install wheel
          pip install cpplint             

After this code block I try to run cpplint:

- name: cpplint
      working-directory: ${{runner.workspace}}/uast      
      shell: bash         
      run: cpplint --recursive --exclude=source/catch.hpp --filter=-legal/copyright,-build/include_subdir source/*       

But after successful installation (in the first block) I got "line 1: cpplint: command not found" in the second one.


Solution

  • Please try python -m cpplint:

    - name: cpplint
          working-directory: ${{runner.workspace}}/uast      
          shell: bash         
          run: python -m cpplint --recursive --exclude=source/catch.hpp --filter=-legal/copyright,-build/include_subdir source/* 
    

    Modules installed over pip are not recognized as system level command.