Browse Source

pylint: enable various optional checks/extensions

https://github.com/fphammerle/freesurfer-volume-reader/commit/c02a5655a6edfa5155625dd3e002f9e3a91a0635
https://github.com/fphammerle/ical2vdir/commit/3ddcbbd3e757644be6e32cf1c6135c82c845b4ab
Fabian Peter Hammerle 1 year ago
parent
commit
706ead5c4c
2 changed files with 24 additions and 6 deletions
  1. 23 5
      .pylintrc
  2. 1 1
      cc1101/__init__.py

+ 23 - 5
.pylintrc

@@ -1,9 +1,27 @@
 [MASTER]
 
-extension-pkg-whitelist = spidev
+extension-pkg-whitelist=spidev
 
-[MESSAGE CONTROL]
+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
 
-disable = missing-class-docstring,
-          missing-function-docstring,
-          missing-module-docstring
+[MESSAGES CONTROL]
+
+disable=consider-alternative-union-syntax, # requires python>=3.10
+        deprecated-typing-alias, # requires python>=3.9, e.g. for dict[...]
+        missing-class-docstring,
+        missing-function-docstring,
+        missing-module-docstring

+ 1 - 1
cc1101/__init__.py

@@ -460,7 +460,7 @@ class CC1101:
                 "\ncall .set_sync_mode(cc1101.SyncMode.NO_PREAMBLE_AND_SYNC_WORD)"
                 " to disable preamble"
             )
-        if length % 3 == 0:
+        if length % 3 == 0:  # pylint: disable=consider-ternary-expression
             index = math.log2(length / 3) * 2 + 1
         else:
             index = math.log2(length / 2) * 2