-
Notifications
You must be signed in to change notification settings - Fork 161
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
[INFRA] LGTM recommendation: Unused local variable #853
Conversation
9f54004
to
d643e8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, you have a conflict to solve - but other than that, I think it's good to be merged.
Thanks for your recent series of PRs
The value assigned to local variable 'data' is never used.
14586f9
to
bc96981
Compare
pdf_build_src/process_markdowns.py
Outdated
@@ -16,7 +16,7 @@ | |||
import numpy as np | |||
|
|||
sys.path.append("../tools/") | |||
from schemacode import macros | |||
from schemacode import macros # lgtm [py/unused-import] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is importing macros
somehow required? or could we also remove this line? cc @tsalo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe its is required because we later call eval("macros.some_function(...)")
:
https://github.com/bids-standard/bids-specification/blob/dd377ae/pdf_build_src/process_markdowns.py#L457
Thus, the lgtm
suppression comment is quite useful, it reminds maintainers of this atypical call of macros.
functions. I don't know if there's an equivalent noqa
error code, but note that noqa
support in LGTM.com is buggy (github/codeql#6517).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! Yes, I have used ... # noqa: F401
before. It that works, it'd be preferable to the LGTM thing, I think.
Perhaps even a comment like: ... # noqa: F401 --> it's used in "eval" below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple noqa
would be taken into account by LGTM.com, but not noqa: F401
. What about these options?
# noqa (used in "eval" call below)
# noqa: F401 (noqa because used in "eval" call below)
# noqa: F401 lgtm [py/unused-import] (used in "eval" call below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for option 2, if that works, else option 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 OK for option 2, I believe the LGTM regex will catch the second lone noqa
:-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2 is too long, and I have just noticed the second noqa
requires spaces around it.
I've pushed option 1.
bc96981
to
b6e32a8
Compare
Import of 'macros' is not used.
b6e32a8
to
bb6065a
Compare
Thanks @DimitriPapadopoulos |
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand. Veuillez saisir le message de validation pour vos modifications. Les lignes
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
Previous commit bb6065a from bids-standard#853 does not work around the LGTM alert. We attempt to silence the LGTM alert using an lgtm.yml file, and use standard Flake8 noqa suppression comments to document the issue at hand.
The value assigned to local variable 'data' is never used.