servo/servo — pull request #4515 by brunoabinader (2014-12-30 15:51:53+00:00)
Title: Codegen cleanup

Main changes:
- Whitespace (indent) fixes;
- CGIndent-related fixes;
- Removed consecutive empty lines;
- Removed empty lines before closing brackets;
- Codegen style fixes;

Tests:

We don't have a static code style analyzer yet, so I've checked using the following (together with manual lookup at some selected generated bindings):

1. Check for lines with wrong indentation (1 to 3 whitespaces at the beginning)
Command: $ pcregrep -r "^[ ]{1,3}[^ ]" components/script/dom/bindings/codegen/Bindings
Expected: None
Actual: None

2. Check for lines with wrong indentation (5 to 7 whitespaces at the beginning)
Command: $ pcregrep -r "^[ ]{5,7}[^ ]" components/script/dom/bindings/codegen/Bindings
Expected: None
Actual: None

3. Check for lonely semicolons
Command: $ pcregrep -r " \{0,\};" components/script/dom/bindings/codegen/Bindings
Expected: None
Actual: None

4. Check for consecutive empty lines
Command: $ pcregrep -r -M "^$\n^$\n" components/script/dom/bindings/codegen/Bindings
Expected: None
Actual:
components/script/dom/bindings/codegen/Bindings/ChildNodeBinding.rs
components/script/dom/bindings/codegen/Bindings/ElementCSSInlineStyleBinding.rs
components/script/dom/bindings/codegen/Bindings/ParentNodeBinding.rs
components/script/dom/bindings/codegen/Bindings/URLUtilsBinding.rs
components/script/dom/bindings/codegen/Bindings/URLUtilsReadOnlyBinding.rs
All of the above are [NoInterfaceObject], thus providing only imports. We shouldn’t, however, generate empty lines (investigate this later on).

5. Check for empty lines before closing brackets
Command: $ pcregrep -A2 -B2 -r -M "^$\n {0,}\}" components/script/dom/bindings/codegen/Bindings
Expected: None
Actual: None