Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmach fmt calls clang-format #24552
mach fmt calls clang-format #24552
Conversation
highfive
commented
Oct 25, 2019
|
Heads up! This PR modifies the following files:
|
|
Does clang-format have something like servo/python/servo/testing_commands.py Lines 335 to 338 in b7b1b90 |
No. clang-format is very limited. I'm gonna have to implement that manually. Also, note to self, clang-format is not guaranteed to be installed on Mac and Linux. |
|
There's an option to get a XML output. I will use that. |
|
@SimonSapin r? |
|
We will need to install clang-format on the CI machines. |
|
Since this requires an externally-installed tool I’d prefer we make this either opt-in or opt-out. How fast is clang-format? If not very, can we only run it on files that have been changed like tidy Dependencies for Linux CI tasks are installed here https://github.com/servo/servo/blob/master/etc/taskcluster/docker/build.dockerfile. Modifying this file in your PR should Just Work. r? @jdm |
|
Note to self:
|
Do we need both? Isn’t it enough if CI runs clang-format once on all source files? |
|
|
|
I change the logic a bit:
There's an issue where Visual Studio use clang-format 6, not 9 (the one available on MacOS and probably Linux). And the clang format configurations files are not compatible between versions (that's why I'm checking the clang-format version). As for the speed, now it only scan files that have changed. It's fast. I am not changing the CI configuration for osx or linux, as I think it should only be tested on Windows, where the supported version is supposed to be installed. Also, for now, we only check HoloLens code, so it makes sense to support the Windows version. I'm not sure though how my Visual Studio version got |
|
@jdm r? |
| return False, None, None | ||
| gitcmd = ['git', 'ls-files'] | ||
| if not all_files: | ||
| gitcmd.append('-m') |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=jdm |
|
|
|
|
|
@bors-servo retry |
|
|
|
@bors-servo retry |
|
|
|
|
paulrouget commentedOct 25, 2019
Fix #24031
What would be the right way to also integrate this with tidy?