-
Notifications
You must be signed in to change notification settings - Fork 272
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
Using a docker container for clang-cl #580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to consider trying to use a local clang-format if available (and the right version)?
Something like
if clang-format-17 --version | grep -qF 'version 17.'; then
clang_format=( clang-format-17 )
elif clang-format --version | grep -qF 'version 17.'; then
clang_format=( clang-format )
else
if [ -t 0 ]; then DOCKER_ARGS=-it; fi
clang_format=( docker run --rm $DOCKER_ARGS -v "$MAINSOURCE:/app:Z" -w "/app" -u "$(id -u $USER):$(id -g $USER)" kszonek/clang-format-17 )
fi
"${clang_format[@]}" "$@"
Then we can use that script as if it were clang-format
itself, passing e.g. tools/clang-format.sh --style=file --verbose -i -- $ALL_CROARING_FILES
in a wrapper
@Dr-Emann Please re-review. |
@Dr-Emann I have updated the script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a comment, but don't want to hold things up for it
Merging. |
* Using a docker container for clang-cl --------- Co-authored-by: Daniel Lemire <[email protected]>
To fix the clang-format version, use a Docker container.
See #577 (comment)