]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
typing: appease pyright and disable mypy unusued import warning 822/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 4 Oct 2021 15:17:06 +0000 (17:17 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 4 Oct 2021 15:17:06 +0000 (17:17 +0200)
Since pyright reuses the same comments to ignore types, one can get into
unsatisfiable situations, where one type checker accepts something but the other
doesn't. At this point we only have three instances of type ignore hints anyway,
sol et's relax our mypy settings somewhat, so that we can shut up pyright, when
necessary.

mkosi/__init__.py
setup.cfg

index 665f5f4cfe098119dc50c01632b26968fae1d4ae..45642c7fe93ca97a414cad6665a7ea0c29aa9b2c 100644 (file)
@@ -3913,7 +3913,7 @@ def install_unified_kernel(
         # Apparently openmandriva hasn't yet completed its usrmerge so we use lib here instead of usr/lib.
         with os.scandir(root / "lib/modules") as d:
             for kver in d:
-                if not (kver.is_dir() and os.path.isfile(os.path.join(kver, "modules.dep"))):
+                if not (kver.is_dir() and os.path.isfile(os.path.join(kver, "modules.dep"))): # type: ignore
                     continue
 
                 prefix = "/boot" if args.xbootldr_partno is not None else "/efi"
index 5f51b744d32ce928b2f037b23a2e063e84a06c87..7f6c9750695f99be04efba2cc632c766855e7e63 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ disallow_incomplete_defs = True
 check_untyped_defs = True
 no_implicit_optional = True
 warn_redundant_casts = True
-warn_unused_ignores = True
+warn_unused_ignores = False
 warn_return_any = True
 no_implicit_reexport = True
 # extra options not in --strict