You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- repo: https://github.com/pre-commit/mirrors-clang-formatrev: "v18.1.2"hooks:
- id: clang-format# Supports a lot more filetypes, but only tagging those we use# https://github.com/pre-commit/mirrors-clang-format/blob/main/.pre-commit-hooks.yaml#L6types: [file]files: ".*\\.(cpp|cxx|h)"
pre-commit run --all
But I'd like to have this as a github action as well. Running locally, I try pipx run clang-format --dry-run **/*.h **/*.cpp and it gives the following output:
⚠️ clang-format is already on your PATH and installed at C:\Program Files\Python39\Scripts\clang-format.EXE. Downloading and running anyway.
invalid argument
invalid argument
I also tried to pass all the files in (powershell):
ResourceUnavailable: Program 'clang-format.exe' failed to run: An error occurred trying to start process 'C:\Program Files\Python39\Scripts\clang-format.exe' with working directory 'E:\Users\Avasam\Documents\Git\pywin32'. The filename or extension is too long.At line:1 char:1
+ clang-format --dry-run $files
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
The text was updated successfully, but these errors were encountered:
Can you please check whether there is a difference between 18.1.1 and 18.1.2 for this? We recently changed the inner workings of our packaging and I would like to know whether this is related to that change.
Hi, 18.1.1 gives me the same results as 18.1.2 and 18.1.5. It doesn't seem like there's support for some sort of include/exclude globbing. Hence I'm currently having to resort to git commands to get the files I want:
- run: | # Too many files to fit in a single command, exclude vendored Scintilla and mapi_headers clang-format --Werror --dry-run $(git ls-files '*.cpp') clang-format --Werror --dry-run $(git ls-files '*.h' ':!:Pythonwin/Scintilla/' ':!:com/win32comext/mapi/src/mapi_headers/')
The pre-commit configuration works fine:
pre-commit run --all
But I'd like to have this as a github action as well. Running locally, I try
pipx run clang-format --dry-run **/*.h **/*.cpp
and it gives the following output:I also tried to pass all the files in (powershell):
But that just resulted in
The text was updated successfully, but these errors were encountered: