From b5aa3db3d0a370c016ddd8b2fe51231a63e6b3e5 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Tue, 8 Jun 2021 08:22:46 -0400 Subject: [PATCH] Make LGTM ignore false positives --- dandi/__init__.py | 2 +- dandi/conftest.py | 2 +- dandi/due.py | 4 ++-- dandi/support/generatorify.py | 2 +- dandi/support/iterators.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dandi/__init__.py b/dandi/__init__.py index 55ece7941..1682a54e3 100644 --- a/dandi/__init__.py +++ b/dandi/__init__.py @@ -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", diff --git a/dandi/conftest.py b/dandi/conftest.py index 9a0eaf16b..924a32d14 100644 --- a/dandi/conftest.py +++ b/dandi/conftest.py @@ -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): diff --git a/dandi/due.py b/dandi/due.py index 720b0b6ef..3b3fc88b6 100644 --- a/dandi/due.py +++ b/dandi/due.py @@ -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") @@ -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: diff --git a/dandi/support/generatorify.py b/dandi/support/generatorify.py index 6837dcc27..5192e4842 100644 --- a/dandi/support/generatorify.py +++ b/dandi/support/generatorify.py @@ -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: diff --git a/dandi/support/iterators.py b/dandi/support/iterators.py index ddac254a3..05a7e306e 100644 --- a/dandi/support/iterators.py +++ b/dandi/support/iterators.py @@ -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 @@ -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]