Skip to content

Commit

Permalink
Make LGTM ignore false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jun 8, 2021
1 parent ed93dad commit b5aa3db
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dandi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .due import Doi, due

due.cite(
Doi("10.5281/zenodo.3692138"),
Doi("10.5281/zenodo.3692138"), # lgtm [py/procedure-return-value-used]
cite_module=True, # highly specialized -- if imported, means used.
description="Client to interact with DANDI Archive",
path="dandi-cli",
Expand Down
2 changes: 1 addition & 1 deletion dandi/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .tests.fixtures import * # noqa: F401, F403
from .tests.fixtures import * # noqa: F401, F403 # lgtm [py/polluting-import]


def pytest_addoption(parser):
Expand Down
4 changes: 2 additions & 2 deletions dandi/due.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _donothing_func(*args, **kwargs):


try:
from duecredit import due, BibTeX, Doi, Url, Text
from duecredit import due, Doi # lgtm [py/unused-import]

if "due" in locals() and not hasattr(due, "cite"):
raise RuntimeError("Imported due lacks .cite. DueCredit is now disabled")
Expand All @@ -68,7 +68,7 @@ def _donothing_func(*args, **kwargs):
)
# Initiate due stub
due = InactiveDueCreditCollector()
BibTeX = Doi = Url = Text = _donothing_func
Doi = _donothing_func

# Emacs mode definitions
# Local Variables:
Expand Down
2 changes: 1 addition & 1 deletion dandi/support/generatorify.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __call__(self, callback):
while True:
try:
v_from_c = callback(from_g)
except BaseException as e_from_c:
except BaseException as e_from_c: # lgtm [py/catch-base-exception]
try:
from_g = g.throw(e_from_c)
except StopIteration as si:
Expand Down
4 changes: 2 additions & 2 deletions dandi/support/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def worker():
self.total = total = (
self.agg(value, total) if total is not None else self.agg(value)
)
except BaseException as e:
except BaseException as e: # lgtm [py/catch-base-exception]
self._exc = e
finally:
self.finished = True
Expand All @@ -114,4 +114,4 @@ def worker():
continue
t.join()
if self._exc is not None:
raise self._exc
raise self._exc # lgtm [py/illegal-raise]

0 comments on commit b5aa3db

Please sign in to comment.