Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve a single empty line between attributes #239

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

awalterschulze
Copy link
Contributor

Fixes #233

Tests

erlfmt_SUITE_data/attribute.erl already tests quite a few cases of preserving empty lines.
Added one test to make sure that more than one empty line is reduced to a single empty line.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 20, 2021
@awalterschulze awalterschulze changed the title preserve only empty line between attributes preserve a single empty line between attributes Jan 20, 2021
@awalterschulze awalterschulze force-pushed the preserve_one_empty_line branch from 3172fdd to 271103c Compare January 20, 2021 13:36
Copy link
Member

@michalmuskala michalmuskala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a left-over io:format

@@ -198,6 +221,7 @@ split_tokens(Tokens, ExtraTokens0) ->
{[], Comments} ->
{[], Tokens, Comments, ExtraTokens0};
{TransformedTokens, Comments} ->
% io:format(user, "tokens: ~p~n", [Tokens]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️

Suggested change
% io:format(user, "tokens: ~p~n", [Tokens]),

@awalterschulze awalterschulze force-pushed the preserve_one_empty_line branch from 271103c to a95de00 Compare January 20, 2021 13:46
@awalterschulze awalterschulze force-pushed the preserve_one_empty_line branch from a95de00 to 3e958f0 Compare January 20, 2021 13:47
@awalterschulze awalterschulze merged commit 55de291 into master Jan 20, 2021
@awalterschulze awalterschulze deleted the preserve_one_empty_line branch January 20, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve at most a single empty line between attributes
3 participants