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

unreachable_code_linter hits #nolint messages #1347

Closed
MichaelChirico opened this issue Jun 2, 2022 · 4 comments · Fixed by #1418
Closed

unreachable_code_linter hits #nolint messages #1347

MichaelChirico opened this issue Jun 2, 2022 · 4 comments · Fixed by #1418
Labels
false-positive code that shouldn't lint, but does

Comments

@MichaelChirico
Copy link
Collaborator

MichaelChirico commented Jun 2, 2022

function() {
  do_something
  # nolint start: one_linter.
  edge_case_stuff()
  # nolint stop: one_linter.
}

will throw the lint on # nolint stop. this seems less than ideal but I'm not sure if it can be easily fixed.

@MichaelChirico MichaelChirico added the false-positive code that shouldn't lint, but does label Jun 2, 2022
@AshesITR
Copy link
Collaborator

AshesITR commented Jun 2, 2022

Maybe never lint COMMENT nodes?

@MichaelChirico
Copy link
Collaborator Author

Actually comments were one of the things I definitely wanted to lint. Often see things like

function() {
  do_something()
  # print(x)
}

i.e., vestigial comments that should probably be removed (or at least moved away from the very end of the function)

@AshesITR
Copy link
Collaborator

AshesITR commented Jun 2, 2022

Shouldn't that be a separate lint message at least? Trailing comments aren't exactly unreachable code.

Also, just to clarify, these lints are excluded by exclude(), right?

@MichaelChirico
Copy link
Collaborator Author

Oh, good point. Edited the issue -- they're not excluded because they're specific to a different linter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-positive code that shouldn't lint, but does
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants