Skip to content

Empty lines before semi#296

Closed
mightyiam wants to merge 1 commit intoNixOS:masterfrom
mightyiam:empty-lines-before-semi
Closed

Empty lines before semi#296
mightyiam wants to merge 1 commit intoNixOS:masterfrom
mightyiam:empty-lines-before-semi

Conversation

@mightyiam
Copy link

Just a failing test case for what I would suggest to be a possible improvement.

@github-actions
Copy link

github-actions bot commented Apr 30, 2025

Nixpkgs diff

@piegamesde
Copy link
Member

Why are you randomly adding failing test cases? If you have an issue with the formatter, please open one instead. Either way, the current behavior is by design

- Line breaks may be added or removed, but empty lines must not be created. Single empty lines must be preserved, and consecutive empty lines must be collapsed into a single empty line.

#201

but personally, I'd be open to a discussion re-evaluating it

@mightyiam
Copy link
Author

Did you chide me for opening a PR with a failing test case instead of an issue?

@piegamesde
Copy link
Member

Yes. That test case doesn't properly follow the layout for tests btw. Also, these are snapshot tests and not unit tests. They are automatically generated and exist to track changes in the formatter, not to expect a specific output. Manually writing a test's output is bound to fail for most non-trivial inputs, and generally non-trivial tests which test as many corner cases as possible are preferred.

@jfly
Copy link
Collaborator

jfly commented Apr 30, 2025

Closing this in favor of #298.

@mightyiam, please file GitHub issues for future formatting suggestions. This policy will be made clear in this upcoming README update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants