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

Lint multiline attributes properly #2473

Merged
merged 1 commit into from
Feb 21, 2018

Conversation

phansch
Copy link
Member

@phansch phansch commented Feb 21, 2018

This makes it so that the empty_line_after_outer_attribute lint only
checks for newlines between the end of the attribute and the beginning
of the following item.

We need to check for the empty line count being bigger than 2 because
now the snippet of valid code contains only \n and splitting it
produces ["", ""]
Invalid code would contain more than 2 empty strings.

Closes #2428

This makes it so that the `empty_line_after_outer_attribute` lint only
checks for newlines between the end of the attribute and the beginning
of the following item.

We need to check for the empty line count being bigger than 2 because
now the snippet of valid code contains only `\n` and splitting it
produces `["", ""]`
Invalid code will contain more than 2 empty strings.
@oli-obk oli-obk merged commit 5e6342d into rust-lang:master Feb 21, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Feb 21, 2018

Nice fix

@phansch phansch deleted the handle_multiline_attributes branch February 21, 2018 20:49
@phansch
Copy link
Member Author

phansch commented Feb 21, 2018

Ah that issue reference was a PR not the issue to be closes 😭 This one should be closed: #2460

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