Skip to content

Keep vertical spaces between items or statements within range #2221

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

Merged
merged 13 commits into from
Dec 6, 2017

Conversation

topecongiro
Copy link
Contributor

Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! The code looks good, but I think the upper bound default should be 2 rather than 1. Could you also add a couple of tests checking some other configurations please? (In particular which require inserting newlines, with and without comments).

@@ -651,6 +651,10 @@ create_config! {
"Add trailing semicolon after break, continue and return";
match_block_trailing_comma: bool, false, false,
"Put a trailing comma after a block based match arm (non-block arms are not affected)";
blank_lines_upper_bound: usize, 1, false,
Copy link
Member

Choose a reason for hiding this comment

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

The default here should be 2.

@topecongiro
Copy link
Contributor Author

Thank you for taking time to review this!

I read your comment and it states that we should have either 0 or 1 blank line between items. Do you mean that the config values should represent the exclusive bound?

@topecongiro
Copy link
Contributor Author

This PR does not handle blank lines around comments. The blank lines in the example below will be kept untouched:

fn foo()



// comment



fn bar() {}

I am going to update this PR, add more tests.

@nrc
Copy link
Member

nrc commented Dec 3, 2017

I read your comment and it states that we should have either 0 or 1 blank line between items. Do you mean that the config values should represent the exclusive bound?

You are correct, sorry - my memory was not as good as I thought :-)

@topecongiro
Copy link
Contributor Author

Updated with handling of comments and tests. My apologies for messy commit history.

@nrc nrc merged commit b07e433 into rust-lang:master Dec 6, 2017
@nrc
Copy link
Member

nrc commented Dec 6, 2017

Thank you!

@topecongiro topecongiro deleted the rfc/blank-lines branch December 6, 2017 03:00
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.

2 participants