Commit 0c3e8a4d authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

[mypy] Silence error based on error codes

parent b1f85e589363
Pipeline #10699 failed with stages
in 2 minutes and 37 seconds
......@@ -53,7 +53,7 @@ try:
except ImportError:
# chardet unvailable
# Name 'chardet' already defined (by an import)
chardet: Optional[ModuleType] = None # type: ignore
chardet: Optional[ModuleType] = None # type: ignore[no-redef]
try:
DEFAULT_ENCODING = locale.getpreferredencoding()
......@@ -229,7 +229,7 @@ class TransformData:
if is_text_mimetype(self.mimetype) and self.is_binary():
raise TransformError()
def binary_decode(self): # type: ignore # FIXME: is self.data a str or a byte?
def binary_decode(self): # type: ignore[no-untyped-def] # FIXME: is self.data a str or a byte?
if self.encoding == "gzip":
import gzip
......
......@@ -105,7 +105,7 @@ class TransformEngine:
def _unmap_transform(self, transform: Transform, *inputs: str) -> None:
"""unmap transform from internal structures"""
if not inputs:
inputs = transform.inputs # type: ignore
inputs = transform.inputs # type: ignore[assignment]
for mt in inputs:
main, sub = split_mimetype(mt)
if sub == "*":
......@@ -135,7 +135,7 @@ class TransformEngine:
shortest = len(path)
return winner
def _get_paths( # type: ignore
def _get_paths( # type: ignore[no-untyped-def]
self, orig: str, target: str, requirements: List[str], path=None, result=None
) -> List[TransformsChain]:
"""return a all path for transformation from orig mimetype to
......
......@@ -83,19 +83,19 @@ class TransformsChain(list):
list.__setitem__(self, key, value)
self._update()
def append(self, value) -> None: # type: ignore[no-untyped-def] # FIXME: is value a Transform?
def append(self, value) -> None: # type: ignore[no-untyped-def] # is value a Transform?
list.append(self, value)
self._update()
def insert(self, *args) -> None: # type: ignore # FIXME: function still used?
def insert(self, *args) -> None: # type: ignore[no-untyped-def] # FIXME: function still used?
list.insert(*args)
self._update()
def remove(self, *args) -> None: # type: ignore # FIXME: function still used?
def remove(self, *args) -> None: # type: ignore[no-untyped-def] # FIXME: function still used?
list.remove(*args)
self._update()
def pop(self, *args) -> None: # type: ignore # FIXME: function still used?
def pop(self, *args) -> None: # type: ignore[no-untyped-def] # FIXME: function still used?
list.pop(*args)
self._update()
......
......@@ -85,7 +85,7 @@ class Parser:
self.out.write("\n</pre>\n")
@deprecation.argument_removed(old_argument_name="line")
def __call__(self, toktype, toktext, sparams):
def __call__(self, toktype, toktext, sparams): # type: ignore # FIXME: still used?
"""Token handler"""
srow, scol = sparams
# calculate new positions
......
[mypy]
ignore_missing_imports = True
show_error_codes = True
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment