Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CustomImportOrder should check that import groups are separated by one line only #3551
Based on the discussion at #3519, CustomImportOrder check should validate the exact number of blank lines between groups if separateLineBetweenGroups option is set to true.
Google Style Guide (section 3.3.3) says that If there are both static and non-static imports, a single blank line separates the two blocks. There are no other blank lines between import statements. In addition, code formatters in popular IDEs remove double blank lines betwen groups (see discussion at #2143). Thus, lets restrict the number of blank lines between import groups to one.
The current implementation of CustomImportOrder allows to have more than one blank line between import groups and this leads to inability of covering the new Google Style Guide (section 3.3.3) rule with the check.
Expected: violation on line 4 since there are more than one line which separates the import groups.
referenced this issue
Nov 14, 2016