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

Skip lint on given line / function / class .. #935

Open
ricardaxel opened this issue Oct 6, 2023 · 1 comment
Open

Skip lint on given line / function / class .. #935

ricardaxel opened this issue Oct 6, 2023 · 1 comment

Comments

@ricardaxel
Copy link
Contributor

Would you be open to add some mechanism to skip linting a given line / function / ... ?

For example through UDAs, following code wouldn't raise any warning.

@("NOLINT(useless_initializer)")
bool b = false;

I can work on a POC if you're ok with the concept

@WebFreak001
Copy link
Member

awesome! Yes this would be very much appreciated. Also it would be great if this worked both with @("nolint(...)") as well as @nolint("...") (for future compatibility or big projects that declare this)

We had the idea before that dub packages could provide files that are always implicitly imported by the compiler, such as object is already, which could provide exactly UDA definitions like this and help the compiler statically check for wrongly used attributes. However these UDA files will still need compiler flag support, which wasn't merged yet / didn't have a compelling use-case yet.

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