Closed
Bug 1405557
Opened 8 years ago
Closed 8 years ago
clang-format not bracing single line if/for/while statements
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox58 affected)
RESOLVED
INVALID
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | affected |
People
(Reporter: n.nethercote, Assigned: andi)
Details
Attachments
(1 file)
|
176 bytes,
text/plain
|
Details |
When I run `./mach clang-format -p` on the attached file it doesn't get changed. Ideally the if, while and for blocks would be braced.
| Reporter | ||
Comment 1•8 years ago
|
||
Hmm, https://stackoverflow.com/questions/26111162/can-clang-format-add-braces-to-single-line-if-statements-etc suggests that clang-format can't insert braces. glandium suggested that it's designed to only change whitespace. That's disappointing.
| Reporter | ||
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Comment 2•8 years ago
|
||
Mike is correct. However, we already have ways to fix that in-tree with clang-tidy.
| Reporter | ||
Comment 3•8 years ago
|
||
(In reply to Sylvestre Ledru [:sylvestre] from comment #2)
> Mike is correct. However, we already have ways to fix that in-tree with
> clang-tidy.
Is there a `mach` command, or something similar, to fix braces with clang-tidy?
Flags: needinfo?(sledru)
Comment 4•8 years ago
|
||
Yes, I have been working on this to give it to you.
It should be:
./mach static-analyzer check --check google-readability-braces-around-statements --fix js/src/asmjs/
but this is blocked by bug 1405602
Flags: needinfo?(sledru)
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bpostelnicu
Updated•8 years ago
|
Product: Core → Firefox Build System
Updated•4 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
•