Closed
Bug 1466070
Opened 7 years ago
Closed 5 years ago
Add clang-format as target of ./mach lint
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox77 fixed)
RESOLVED
FIXED
mozilla77
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
(Depends on 2 open bugs)
Details
Attachments
(3 files, 3 obsolete files)
A development which kept me partly busy in a flight between Paris & SF
I am not sure we want to do but at least, I would like to dump the code and start a discussion.
Currently, we have two ways to call clang-format:
1) ./mach clang-format => will run on a diff
2) ./mach clang-format -p <path> => will run on a path
with the option -s to show the local changes or not.
With
./mach lint -l clang-format
it will run only on whitelist directories (and not sure we have any in our code base?)
We can show the full diff at the end but I am not sure it makes sense to use the mozlint mechanism to show warnings/errors.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
I would be open to something like this, it's kind of similar to a patch I wrote almost a year ago for rustfmt in bug 1369792. I never ended up landing that because the fit was a little awkward (plus rustfmt wasn't stable yet). With rustfmt, there were seprate diffs for each issue, and I was able to stuff them into mozlint's 'source' attribute. I needed to modify the mozlint formatters to actually display this attribute though.
Do you have an example of what the output looks like? I think treating formatters like a linter is fine, though it could be contentious.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → sledru
Assignee | ||
Comment 3•6 years ago
|
||
Lot of work for a small gain, closing for now
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Assignee | ||
Comment 5•5 years ago
|
||
Might be easier with the new option (--dry-run)
https://prereleases.llvm.org/10.0.0/rc3/tools/clang/docs/ReleaseNotes.html#clang-format
I will have a look
Assignee | ||
Updated•5 years ago
|
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Comment 6•5 years ago
|
||
From a high level, I think it would be nice if we kept formatting and linting as two separate commands. See my idea in bug 1511122 (and quick prototype patch in there).
That said, we already do run formatters in mach lint
(at least rustfmt), so there's precedent for adding more if that's easier.
Assignee | ||
Comment 7•5 years ago
|
||
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D69683
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D69685
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D69686
Updated•5 years ago
|
Attachment #9138249 -
Attachment description: Bug 1466070 - install clang-format-10 from apt.llvm.org (wip) → Bug 1466070 - install clang-format-10 from apt.llvm.org r?#linter-reviewers
Updated•5 years ago
|
Attachment #9138248 -
Attachment description: Bug 1466070 - create the new job → Bug 1466070 - mozlint/clang-format: create the new job r?#linter-reviewers
Updated•5 years ago
|
Attachment #9138234 -
Attachment description: Bug 1466070 - Integrate clang-format into mozlint → Bug 1466070 - Integrate clang-format into mozlint r?#linter-reviewers
Updated•5 years ago
|
Attachment #9138252 -
Attachment is obsolete: true
Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Attachment #9138249 -
Attachment is obsolete: true
Updated•5 years ago
|
Attachment #9139314 -
Attachment is obsolete: true
Comment 12•5 years ago
|
||
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11586e57bc1e
Integrate clang-format into mozlint r=linter-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/bb752332e3f7
mozlint/clang-format: create the new job r=ahal
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/11586e57bc1e
https://hg.mozilla.org/mozilla-central/rev/bb752332e3f7
Status: REOPENED → RESOLVED
Closed: 6 years ago → 5 years ago
status-firefox77:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Updated•3 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
•