diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ba72d664..6f4d77f2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,3 +88,7 @@ repos: hooks: - id: isort name: isort (python) +- repo: https://github.com/asottile/yesqa + rev: v1.5.0 + hooks: + - id: yesqa diff --git a/girder/girder_large_image/rest/large_image_resource.py b/girder/girder_large_image/rest/large_image_resource.py index 2814b2212..652e58b38 100644 --- a/girder/girder_large_image/rest/large_image_resource.py +++ b/girder/girder_large_image/rest/large_image_resource.py @@ -112,7 +112,7 @@ def cursorNextOrNone(cursor): :returns: the next value or None. """ try: - return cursor.next() # noqa - B305 + return cursor.next() except StopIteration: return None @@ -577,7 +577,7 @@ def configValidate(self, config): config = config.read().decode('utf8') return self._configValidate(config) - @autoDescribeRoute( # noqa + @autoDescribeRoute( Description('Reformat a Girder config file') .param('config', 'The contents of config file to format.', paramType='body'), diff --git a/large_image/cache_util/cache.py b/large_image/cache_util/cache.py index f6eeeb14a..d2e57a811 100644 --- a/large_image/cache_util/cache.py +++ b/large_image/cache_util/cache.py @@ -117,7 +117,7 @@ class LruCacheMetaclass(type): namedCaches = {} classCaches = {} - def __new__(metacls, name, bases, namespace, **kwargs): # noqa - N804 + def __new__(metacls, name, bases, namespace, **kwargs): # Get metaclass parameters by finding and removing them from the class # namespace (necessary for Python 2), or preferentially as metaclass # arguments (only in Python 3). diff --git a/large_image/tilesource/__init__.py b/large_image/tilesource/__init__.py index 7ac8c2545..4ace39d79 100644 --- a/large_image/tilesource/__init__.py +++ b/large_image/tilesource/__init__.py @@ -145,7 +145,7 @@ def getTileSourceFromDict(availableSources, pathOrUri, *args, **kwargs): sourceName = getSourceNameFromDict(availableSources, pathOrUri, *args, **kwargs) if sourceName: return availableSources[sourceName](pathOrUri, *args, **kwargs) - if not os.path.exists(pathOrUri) and '://' not in pathOrUri: + if not os.path.exists(pathOrUri) and '://' not in str(pathOrUri): raise TileSourceFileNotFoundError(pathOrUri) raise TileSourceError('No available tilesource for %s' % pathOrUri) diff --git a/large_image/tilesource/base.py b/large_image/tilesource/base.py index fa11d3437..89d985f16 100644 --- a/large_image/tilesource/base.py +++ b/large_image/tilesource/base.py @@ -995,7 +995,7 @@ def _pilFormatMatches(self, image, match=True, **kwargs): # compatibility could be an issue. return False - @methodcache() # noqa + @methodcache() def histogram(self, dtype=None, onlyMinMax=False, bins=256, # noqa density=False, format=None, *args, **kwargs): """