ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

How does the `exclude` parameter work? #56

Closed FlorianReimold closed 1 year ago

FlorianReimold commented 1 year ago

I have the following line in my GH Action:

exclude: "/thirdparty/*,/_build/*,convert_utf.cpp,convert_utf.h,/testing/*"

https://github.com/eclipse-ecal/ecal/blob/8725500f16f3b70fa3f084d5d98a71b3cfaf6fae/.github/workflows/clang-tidy-review.yml#L35

The last list item is supposed to exclude all files and all subfolders from the /testing/ folder. It however does not work and still scans files from testing. Any suggestions on what I did wrong?

ZedThree commented 1 year ago

exclude is handled using fnmatch:

    for pattern in exclude:
        files = [f for f in files if not fnmatch.fnmatch(f, pattern)]

where files is a list of relative paths of changed files in the PR. So you should just have to drop the leading /

FlorianReimold commented 1 year ago

Ah, thanks, I changed it accordingly!