indent tool: cleaning up source code



Firefox Build System
7 years ago
3 months ago


(Reporter: joey, Unassigned)


Firefox Tracking Flags

(Not tracked)




7 years ago
Not entirely sure what category this one belongs in...

It would be handy to have a tool like GNU indent configured/available, able to reformat code according to Mozilla's established coding guidelines.  Prior to code review or checkin the tool could be used to reformat sources, expand tabs, adjust braces, etc, etc, etc to resolve any simple/silly formatting problems.

# python flavor

# perl - using emacs --batch

Use of a single tool for reformatting would be optimal but front end shell script could be used to bury details if more than one answer is needed.

2nd round of edits could involve repository commit hooks so reformatting would happen automagically.

Oh and if sources are being identified by extension other functionality could be added.  --lint for instance:
   .py -> invoke pylint on sources
       * emacs --batch
[ ... ]
This belongs in a Gecko product/component IMHO. Putting in Core: Build Config because I'm not sure where else to put it.
Component: Release Engineering → Build Config
Product: → Core
QA Contact: release → build-config
Version: other → unspecified

Comment 3

7 years ago
I'm not strictly opposed to this, but there are plenty of cases where readability trumps the normal rules, or where the rules produce odd results. Plus our codebase has several established patterns that we probably don't want to "fix". So we need to be careful to use this judiciously.

Comment 4

7 years ago
(In reply to Joey Armstrong [:joey] from comment #1)
> Style guide on MDN

Here is another lint/perl resource that someone suggested using this morning.
>> Gregory Szorc [:gps] 
>> I also recommend running Perl through Perl::Critic.
>> If you don't have that installed locally, go to


3 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.