【问题标题】:cpplinter in github actionsgithub操作中的cpplinter
【发布时间】:2023-03-04 11:48:01
【问题描述】:

我想在 Github 操作中借助 cpplint 安装自动检查我的代码。

我尝试将它安装在这样的工作流文件中:

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

在这个代码块之后我尝试运行 cpplint:

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

但在成功安装后(在第一个块中),我在第二个块中得到“line 1: cpplint: command not found”。

【问题讨论】:

    标签: c++ github github-actions linter


    【解决方案1】:

    请尝试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/* 
    

    通过 pip 安装的模块不会被识别为系统级命令。

    【讨论】:

      猜你喜欢
      • 2021-05-12
      • 2022-01-04
      • 2020-05-02
      • 2022-11-21
      • 1970-01-01
      • 2022-08-16
      • 2020-03-10
      • 2023-02-14
      • 1970-01-01
      相关资源
      最近更新 更多