.clang-format files in subdirectories ignored
(Developer Infrastructure :: Lint and Formatting, task)
(Reporter: benc, Unassigned)
For Thunderbird we've got a
./mach clang-format doesn't seem to pick up.
Steps to replicate (assumes you've got
comm/ checked out):
$ ./mach clang-format -s -p comm/mailnews/base/src/nsMsgDBView.cpp
Should be no results - the file follows the CC conventions.
clang-format complains about a huge number of lines.
(Background: MC changed to
Thingy* foo over
Thingy *foo while we were reformatting everything, and we decided to avoid another pass and stick with the CC-prevalent
Thingy *foo style, at least for now).
4 years ago
I think the problem occurs because the mach frontend to clang-format first copies the files out into a tmp dir (under obj-... ) before invoking clang-format upon it. And because the file is no longer under comm/, our .clang-format is being ignored.
There seem to be a bunch of
.clang-format files in M-C subdirectories too - I assume they suffer a similar issue?
Oddly, people have reported that it works OK on windows. Just Linux (and mac?) which are affected?
Quick & dirty workaround:
./mach clang-format, copy
comm/.clang-format to somewhere above the tmp dir, eg:
$ cp comm/.clang-format obj-x86_64-pc-linux-gnu/
4 years ago
Ok, this probably explains why I see so many fix-ups in the diff file...
10 months ago
8 months ago