Open Bug 1188202 (clang-format) Opened 9 years ago Updated 2 years ago

[meta] Reformat everything to the Google coding style

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

People

(Reporter: poiru, Unassigned)

References

(Depends on 18 open bugs, )

Details

(Keywords: meta)

We clang-format all code on a directory-by-directory basis. Once everything is more or less proper Mozilla style, we can integrate clang-format into the development workflow.
Depends on: 1204606
Depends on: 1222666
Depends on: 1274087
Depends on: 1322321
Depends on: 1324382
Depends on: 1328844
Depends on: 1329191
Depends on: 1340143
Depends on: 1340144
I don't think this should be a goal. Please link to the discussion that lead to this decision.
Flags: needinfo?(birunthan)
Unifying Mozilla style has been discussed on mozilla.dev.platform numerous times. Because people have strong feelings for and against this, these discussions have never led anywhere. Together with bsmedberg (who is the effective owner of C++ code style), we decided to delegate the decision to our distinguished engineers. bz, dbaron, roc, and I got together during the Orlando work week and decided we *should* unify our code style using an automated tool like clang-format. There were some open questions regarding e.g. rebasing over code style changes, but the decision still holds. If you have specific concerns about how a unified code style would negatively affect you, please let us know!
Flags: needinfo?(birunthan)
Just like Birunthan said. I am currently working on it. We are currently working on clang-format to address some bugs and difference of behavior with our coding style.
(In reply to Birunthan Mohanathas [:poiru] from comment #2) > Unifying Mozilla style has been discussed on mozilla.dev.platform numerous > times. Because people have strong feelings for and against this, these > discussions have never led anywhere. > > Together with bsmedberg (who is the effective owner of C++ code style), we > decided to delegate the decision to our distinguished engineers. bz, dbaron, > roc, and I got together during the Orlando work week and decided we *should* > unify our code style using an automated tool like clang-format. There were > some open questions regarding e.g. rebasing over code style changes, but the > decision still holds. > > If you have specific concerns about how a unified code style would > negatively affect you, please let us know! I have concerns about it both specifically and in general that I feel were never addressed. What is the correct forum to discuss this?
Flags: needinfo?(birunthan)
> What is the correct forum to discuss this? You can expose your concerns here Jeff.
Flags: needinfo?(birunthan)
Depends on: 1340878
(In reply to Sylvestre Ledru [:sylvestre] from comment #3) > Just like Birunthan said. I am currently working on it. We are currently > working on clang-format to address some bugs and difference of behavior with > our coding style. This isn't actually a well known thing. Perhaps the Orlando decision was communicated in some forum that didn't reach everybody, or didn't sink in. At the least, all the module owners should be formally informed and given a chance to understand the reasons and implications. I don't see them all on the CC-list in this bug, and I'd probably want them all needinfo'd and signing off on this decision, for their module. Doesn't feel like something you would want to railroad "from the top" overriding the module owners. And then you'd want to check with all the managers that are responsible for delivering functionality during the period that these changes would come online. For example, I will oppose any graphics code being touched for "white space" type of changes during 2017 because of the Quantum Render project. Last thing we need is a code churn making things more difficult. Unless this project is also P0 priority, that is.
Depends on: 1342657
Depends on: 1342665
Depends on: 1343068
Depends on: 1347474
Depends on: 1374720
Depends on: 1376803
Depends on: 1378250
Depends on: 1387035
Depends on: 1387036
Depends on: 1389898
Depends on: 1391219
Depends on: 1391231
Depends on: 1391233
Depends on: 1392012
Depends on: 1395296
Depends on: 1396515
Depends on: 1397453
Depends on: 1397457
Depends on: 1399087
Depends on: 1399102
Depends on: 1340083
Depends on: 1399359
Depends on: 1403150
Depends on: 1403292
Depends on: 1406310
Depends on: 1410472
Depends on: 1410938
Depends on: 1411004
Depends on: 1411807
Depends on: 1413103
Depends on: 1413490
Depends on: 1413609
Depends on: 1413612
Depends on: 1414764
Depends on: 1405554
Depends on: 1429015
Depends on: 1430360
Depends on: 1430792
Depends on: 1431030
Product: Core → Firefox Build System
Depends on: 1488687
Depends on: 1497779
Depends on: 1498586
Depends on: 1498608
Depends on: 1498618
Depends on: 1499323
Component: Source Code Analysis → Lint and Formatting
Depends on: 1340183
Depends on: 1405914
Depends on: 1423111
Depends on: 1422418
Depends on: 1505372
Depends on: 1505943
Depends on: 1505949
Depends on: 1506117
Depends on: 1506177
Depends on: 1506538
Here is the ugly script that I am using: --- LIST=$(find . -maxdepth 1 -type d|grep -v "^.$"|grep -v /obj|grep -v "\.deps"|grep -v .hg|grep -v third_par|grep -v "\./\.") echo $LIST for f in $LIST; do echo "$f"; for i in {1..7}; do ./mach clang-format -p $f; done hg revert $( find $f -iname '*.java') || true hg commit -m "reformat of $f" $f done --- Note that I am running clang-format on the directory 7 times because there are things (realignment of comments in /* */) in a single pass.
Depends on: 1507007
Depends on: 1507711
Depends on: 1502068
Depends on: 1508062
Depends on: 1508128
Depends on: 1508180
Depends on: 1508472
Depends on: 1508818
Depends on: 1508826
Depends on: 1508905
Depends on: 1509262
Depends on: 1509265
Depends on: 1507923
Summary: Reformat everything to Mozilla style → Reformat everything to the Google coding style
Depends on: 1510124
Depends on: 1510126
Depends on: 1510128
Depends on: 1510130
Depends on: 1510467
Depends on: 1510478
Depends on: 1510513
Depends on: 1510526
Depends on: 1510458
Depends on: 1510765
Depends on: 1510781
Depends on: 1510787
Depends on: 1510893
Depends on: 1511093
Depends on: 1511140
Depends on: 1511141
Depends on: 1511160
Depends on: 1511176
Depends on: 1511181
Depends on: 1511213
Depends on: 1511284
Depends on: 1511319
Depends on: 1511393
Depends on: 1511501
Depends on: 1511594
Depends on: 1511536
Depends on: 1511668
Depends on: 1511854
Depends on: 1512961
Keywords: meta
Summary: Reformat everything to the Google coding style → [meta] Reformat everything to the Google coding style
Depends on: 1513055
Depends on: 1513205
Depends on: 1513626
Depends on: 1513900
Depends on: 1498489
Depends on: 1515556
Depends on: 1516555
Depends on: 1516755
Depends on: 1518959
Depends on: 1519636
No longer depends on: 1521003
Depends on: 1521000
Depends on: 1521307
Depends on: 1521460
Depends on: 1523279
Depends on: 1525725
Depends on: 1521772
Depends on: 1528492
Depends on: 1530698
Depends on: 1536839
Type: defect → task
Regressions: 1544797
Regressed by: 1547143
Depends on: 1559184
Regressions: 1559184
Depends on: 1560764
Depends on: 1517657
Regressions: 1584696
Depends on: 1599749
Depends on: 1619165
Depends on: 1666129
Depends on: 1670949
Depends on: 1670950
Depends on: 1674281
Depends on: 1680635
Has Regression Range: --- → yes
Has Regression Range: yes → ---
No longer regressed by: 1547143
Depends on: 1781990
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.