Closed
Bug 1510458
Opened 6 years ago
Closed 6 years ago
clang-format with --show edits file given by --path
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox65 fixed)
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: agashlin, Assigned: Sylvestre)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
The command:
./mach clang-format --show --path widget/windows/nsWindow.cpp
will modify nsWindow.cpp, as well as showing the diff. I think the combination should only show the diff for that file.
I think there just needs to be a check for show here:
https://searchfox.org/mozilla-central/rev/0859e6b10fb901875c80de8f8fc33cbb77b2505e/python/mozbuild/mozbuild/mach_commands.py#2836
Assignee | ||
Comment 1•6 years ago
|
||
I agree with you.
Ehsan, ok with you too?
Assignee | ||
Comment 2•6 years ago
|
||
Actually, it is harder than expected because "--show" is lazy: it calls a {hg,git} diff to show the diff on the file.
And this is the goal of "./mach clang-format" => update the code.
Maybe I would just wontfix it.
Comment 3•6 years ago
|
||
No I think the bug as filed is valid. We should fix it. --show is documented to "Show diff output on instead of applying changes" in ./mach clang-format --help. :-)
Flags: needinfo?(ehsan)
Assignee | ||
Comment 4•6 years ago
|
||
1) Creates a temp directory
2) Copy the files
3) Run clang-format on then
4) Diff the files
Assignee | ||
Comment 5•6 years ago
|
||
Depends on D13708
Assignee | ||
Comment 6•6 years ago
|
||
Depends on D13709
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/72412ffdc228
Show the diff without doing the change r=Ehsan
Comment 8•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c9f6a7c04316
Ride along: declare import shutil once r=ahal
https://hg.mozilla.org/integration/autoland/rev/25282bb38b69
Ride along: simplify the declaration (else after a return) r=ahal
Comment 10•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Target Milestone: Firefox 65 → mozilla65
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•