Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Conversation

@asashour
Copy link
Contributor

@asashour asashour commented Jul 8, 2021

This PR introduces a new eol_at_end_of_file rule.

Fixes dart-lang/sdk#58445

@google-cla google-cla bot added the cla: yes label Jul 8, 2021
@coveralls
Copy link

coveralls commented Jul 8, 2021

Coverage Status

Coverage increased (+0.02%) to 94.022% when pulling 0bdb3f8 on asashour:eol_last into c743f88 on dart-lang:master.

@asashour asashour force-pushed the eol_last branch 2 times, most recently from 6a19857 to ad4b32c Compare July 9, 2021 13:44
Copy link
Contributor

@bwilkerson bwilkerson left a comment

Choose a reason for hiding this comment

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

What do you think of extending this to also check that there aren't multiple eol markers in a file?

I can see the benefit in terms of cleanliness. The only downside I can see is that it might trigger when the user adds a couple of blank lines at the end of the file just before typing a new declaration. I suspect those false positives would be acceptable and rare because most people will type the "\n\nclass" fast enough that the linter wouldn't even run when the file's in a bad state.

Copy link
Contributor

@bwilkerson bwilkerson 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 contribution, and thanks for your patience with the review comments. We appreciate both.

@asashour asashour changed the title Implement eol_last rule Implement eol_at_end_of_file rule Jul 9, 2021
Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

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

Fantastic. Thank you!

@pq
Copy link
Contributor

pq commented Jul 9, 2021

See also: dart-lang/sdk#58450.

@pq pq merged commit fadfbcb into dart-archive:master Jul 9, 2021
@asashour asashour deleted the eol_last branch July 10, 2021 07:54
mockturtl added a commit to mockturtl/tidy that referenced this pull request Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

eol_last

4 participants