Browse Source

pylint: enable various optional checks/extensions

https://github.com/fphammerle/ical2vdir/commit/3ddcbbd3e757644be6e32cf1c6135c82c845b4ab
https://github.com/fphammerle/ical2vdir/commit/4dcddd2d1b1b2808acf1d58c6475a64b297a00eb
Fabian Peter Hammerle 1 year ago
parent
commit
14c3f680fc
2 changed files with 23 additions and 3 deletions
  1. 21 1
      .pylintrc
  2. 2 2
      freesurfer_surface/__init__.py

+ 21 - 1
.pylintrc

@@ -1,3 +1,23 @@
+[MASTER]
+
+load-plugins=pylint.extensions.check_elif,
+             pylint.extensions.comparison_placement,
+             pylint.extensions.confusing_elif,
+             pylint.extensions.consider_ternary_expression,
+             pylint.extensions.emptystring,
+             pylint.extensions.eq_without_hash,
+             pylint.extensions.for_any_all,
+             pylint.extensions.mccabe,
+             pylint.extensions.no_self_use,
+             pylint.extensions.overlapping_exceptions,
+             pylint.extensions.private_import,
+             pylint.extensions.redefined_loop_name,
+             pylint.extensions.redefined_variable_type,
+             pylint.extensions.set_membership,
+             pylint.extensions.typing
+
 [MESSAGES CONTROL]
 
-disable=missing-docstring
+disable=consider-alternative-union-syntax, # requires python>=3.10
+        deprecated-typing-alias, # requires python>=3.9, e.g. for dict[...]
+        missing-docstring

+ 2 - 2
freesurfer_surface/__init__.py

@@ -204,7 +204,7 @@ class PolygonalChainsNotOverlapingError(ValueError):
     pass
 
 
-class PolygonalChain:
+class PolygonalChain:  # pylint: disable=eq-without-hash; mutable
     def __init__(self, vertex_indices: typing.Iterable[int]):
         self.vertex_indices: typing.Deque[int] = collections.deque(vertex_indices)
 
@@ -415,7 +415,7 @@ class Surface:
         )
         assert stream.read(4) == self._TAG_OLD_USEREALRAS
         (using_old_real_ras,) = struct.unpack(">I", stream.read(4))
-        assert using_old_real_ras in [0, 1], using_old_real_ras
+        assert using_old_real_ras in {0, 1}, using_old_real_ras
         self.using_old_real_ras = bool(using_old_real_ras)
         assert stream.read(4) == self._TAG_OLD_SURF_GEOM
         # writeVolGeom