Browse Source

pylint: enable various optional checks

https://github.com/fphammerle/pubmed-bibtex/commit/30b274aa28d10b4ba69cbf6bcdc42b4198918e19
Fabian Peter Hammerle 1 year ago
parent
commit
3ddcbbd3e7
3 changed files with 27 additions and 4 deletions
  1. 25 2
      .pylintrc
  2. 1 1
      ical2vdir/__init__.py
  3. 1 1
      tests/cli_test.py

+ 25 - 2
.pylintrc

@@ -1,4 +1,27 @@
-[MESSAGE CONTROL]
+[MASTER]
 
-disable=missing-function-docstring,
+load-plugins=pylint.extensions.bad_builtin,
+             pylint.extensions.broad_try_clause,
+             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,
+             pylint.extensions.while_used
+
+[MESSAGES CONTROL]
+
+disable=consider-alternative-union-syntax, # requires python>=3.10
+        deprecated-typing-alias, # requires python>=3.9, e.g. for dict[...]
+        missing-function-docstring,
         missing-module-docstring

+ 1 - 1
ical2vdir/__init__.py

@@ -97,7 +97,7 @@ def _write_event(event: icalendar.cal.Event, path: pathlib.Path) -> None:
     temp_fd, temp_path = tempfile.mkstemp(
         prefix="ical2vdir-", suffix=_VDIR_EVENT_FILE_EXTENSION
     )
-    try:
+    try:  # pylint: disable=too-many-try-statements
         # > Content lines are delimited by a line break,
         # > which is a CRLF sequence [...]
         # https://tools.ietf.org/html/rfc5545#section-3.1

+ 1 - 1
tests/cli_test.py

@@ -21,7 +21,7 @@ import pathlib
 import subprocess
 import unittest.mock
 
-import _pytest.logging
+import _pytest.logging  # pylint: disable=import-private-name; tests
 import icalendar
 
 import ical2vdir