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

Deletes comments within empty let in #43

Closed
SuperSandro2000 opened this issue Jun 3, 2022 · 3 comments
Closed

Deletes comments within empty let in #43

SuperSandro2000 opened this issue Jun 3, 2022 · 3 comments

Comments

@SuperSandro2000
Copy link

While debugging a package in nixpkgs I noticed the following oddity:
when you format a file which has only comments in the let in, all comments get deleted. Since the comments can be actual code I don't think that is intended.

Before:

_:

let
# those = {};
# are  = {};
# comments = {};
in {}

after:

_:

{}

statix 0.5.4

@nerdypepper
Copy link
Owner

i think the preferred behavior would be to not raise the lint if comments are present?

@SuperSandro2000
Copy link
Author

It should probably raise that still since the let in is unused but this is probably not auto fixable or should move the comment outside the let in.

@nerdypepper
Copy link
Owner

understood, just pushed v0.5.6 for this issue. the behaviour is as follows:

  • no comment present: lint is raised, fix is applied
  • comments only present: lint is raised, fix is not applied

currently there is no way for the user to accept/reject fixes interactively, but ideally, that would be nice for this case.

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

No branches or pull requests

2 participants