Skip to content

Fix whitespace for selective imports#4380

Merged
DmitryOlshansky merged 2 commits intodlang:masterfrom
wilzbach:fix_import_whitespace
May 31, 2016
Merged

Fix whitespace for selective imports#4380
DmitryOlshansky merged 2 commits intodlang:masterfrom
wilzbach:fix_import_whitespace

Conversation

@wilzbach
Copy link
Contributor

Having a space before and after the colon for selective imports seems to be an informal rule and has been critized in many PR's.
I personally prefer import std.range: zip instead of std.range : zip, but the point is to make it a rule and standardize it, so we can automatically check it & no further time is wasted about such nitpicks.

It seems to me that this is can be easily unified and from now on checked with Travis
Command used:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d

Disclaimer: Yes the grep check in Travis doesn't check all cases, but soon dscanner will catch up and this small loophole will be fixed.

There is also an accomponying PR to dlang.org to update the DStyle.

Ping @joakim-noah @schuetzm

wilzbach added 2 commits May 29, 2016 22:09
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
@joakim-noah
Copy link
Contributor

LGTM

@schuetzm
Copy link
Contributor

LGTM too.

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky DmitryOlshansky merged commit f276dbc into dlang:master May 31, 2016
@wilzbach wilzbach deleted the fix_import_whitespace branch June 1, 2016 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants