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

Fix blank lines in file-contents-sorter plugin #944

Merged
merged 1 commit into from
Aug 5, 2023
Merged

Fix blank lines in file-contents-sorter plugin #944

merged 1 commit into from
Aug 5, 2023

Conversation

RoelAdriaans
Copy link
Contributor

As stated in the documentation: Note that this hook WILL remove blank lines. Previously this hook would always add blank a blank line.

With this fix, if the file is empty, a newline will not be added, and multiple blank lines in a file will be removed.

Fixes #935

As stated in the documentation: `Note that this hook WILL remove blank lines`
Previously this hook would always add blank a blank line.

With this fix, if the file is empty, a newline will not be added, and multpline blanklines in a file will be removed.

Fixes #935
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@asottile asottile merged commit 61b5f7e into pre-commit:main Aug 5, 2023
5 checks passed
@szepeviktor

This comment was marked as off-topic.

@pre-commit pre-commit locked as resolved and limited conversation to collaborators Aug 5, 2023
@RoelAdriaans RoelAdriaans deleted the file-content-sorted-blank-line-fix branch August 5, 2023 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

file-contents-sorter adds an extra blank line if the file to be sorted is empty
3 participants