Skip to content

Improve paths handling #155

Description

@ivancho-ifa

First of all, great Action!

I noticed that when setting an absolute path to the compilation database I receive wrong paths.

    - name: Run clang-tidy and clang-format 
      uses: cpp-linter/cpp-linter-action@v2
      id: linter
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
          style: file
          database: ${{github.workspace}}/out/build/${{matrix.arch}}-${{env.BUILD_TYPE}}
          thread-comments: true
          step-summary: true

Produces "D:\a\figures-counter\figures-counter\afigures-counterfigures-counter\out\build\x64-debug" instead of the correct path "D:\a\figures-counter\figures-counter\out\build\x64-debug"

The workaround is to omit the prefix and use relative path

database: out/build/${{matrix.arch}}-${{env.BUILD_TYPE}}

Activity

  1. 2bndy5 commented on Jun 15, 2023

    @2bndy5
    Collaborator

    I think what's happening here might be related to using a Windows runner. The var github.workspace lost all it path delimiters: afigures-counterfigures-counter. This makes me wonder what stripped them. Typically python strings with \ have to be doubled (\\) to escape the misinterpreted reg-exp token. Otherwise you'd get strings with tokens like \a that mean "literal a".

    What perplexes me more is that drive letter D: was stripped as well. I think I have the details to reproduce, and hopefully I can find a fix for this.

  2. added
    bugSomething isn't working
    WindowsExecuted on Wimdows
    on Jun 15, 2023
  3. 2bndy5 commented on Dec 11, 2023

    @2bndy5
    Collaborator

    Paths on windows will be passed to cpp-linter's python package using powershell in the next release. I still have to do a little more testing to make sure clang-tidy can actually find the database on Windows runners where the database option is given an absolute path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsExecuted on WimdowsbugSomething isn't workingcompilation databaseclang-tidy didn't use a compilation database

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions