Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File extension filtering is not working if arg.files list is full paths to files #23

Open
electronjoe opened this issue Mar 15, 2021 · 0 comments

Comments

@electronjoe
Copy link

I am using the following configuration of the GH Action.

        name: "Clang Format Linting"
        uses: DoozyX/[email protected]
        with:
          source: ${{ steps.changed_files.outputs.all }}
          extensions: 'c,h,cpp,hpp'
          clangFormatVersion: 11

Where steps.changed_files.outputs.all is a space delineated list of all changed files in the Pull Request.

For my simple test PR, this equals: source: '.github/workflows/clang-format.yml lte/gateway/c/oai/tasks/nas/emm/msg/DetachAccept.c'

I am observing that Clang-Format is being applied to two files in this PR, which is unexpected. It is analyzing (and failing) on clang-format.yml.

The root cause appears to be within this line of list_files. In my usage (which seems reasonable?) a full file path is being passed for all potential Clang-Tidy targets. Yet this line and the subsequent extension filtering only apply if the arg.files is in fact a directory. Since my arg.files are not directories, no filtering is applied and we skip down to the else clause which appends all arg.files to the set of outputs for analysis.

It seems to me that the filtering logic (exclude and extension based) needs to be replicated for both branches of this if statement. I'll explore doing this and submit a Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant