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

nixf: ignoring annotations #559

Open
Aleksanaa opened this issue Jul 31, 2024 · 0 comments
Open

nixf: ignoring annotations #559

Aleksanaa opened this issue Jul 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Aleksanaa
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Sometimes people need to keep some unused code for convenience reasons, or use other patterns that will throw warnings.

Describe the solution you'd like
Add a pattern in comments to escape some diagnostic messages.

# lint:ignore
foo = { ... };

If there is no content in this line except comments and spaces, ignore all diagnostic reports in the next line, otherwise ignore this line.

# lint:ignore=sema-unused-with,sema-escape-with

Ignore specific types of messages.

# lint:ignore=sema-unused-with:begin

# some code

# lint:ignore=sema-unused-with:end

Ignore code in between, and if no end was found, ignore till file ends.

Also add a command line flag to ignore the ignoring flag (😅)

Describe alternatives you've considered
Maybe there is still room for improvement in the design.

Additional context
NixOS/nixpkgs#331085

@inclyc inclyc changed the title Ignoring flags nixf: ignoring annotations Jul 31, 2024
@inclyc inclyc added the enhancement New feature or request label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants