Add --warn-redundant-casts to mypy checks (#24304)

* add mypy checks for redundant-casts and unused-ignores

* revert unnecessary changes

* ignore

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: ee0021b86c
taco
Dylan Herman 3 years ago committed by GitHub
parent 3e9694d3f3
commit a8910d9d43
  1. 1
      .pre-commit-config.yaml
  2. 2
      selfdrive/hardware/tici/agnos.py

@ -23,6 +23,7 @@ repos:
additional_dependencies: ['git+https://github.com/numpy/numpy-stubs', 'types-requests', 'types-atomicwrites', additional_dependencies: ['git+https://github.com/numpy/numpy-stubs', 'types-requests', 'types-atomicwrites',
'types-pycurl'] 'types-pycurl']
args: args:
- --warn-redundant-casts
- --warn-unreachable - --warn-unreachable
- repo: https://github.com/PyCQA/flake8 - repo: https://github.com/PyCQA/flake8
rev: 4.0.1 rev: 4.0.1

@ -16,7 +16,7 @@ class StreamingDecompressor:
def __init__(self, url: str) -> None: def __init__(self, url: str) -> None:
self.buf = b"" self.buf = b""
self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}) self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}) # type: ignore
self.it = self.req.iter_content(chunk_size=1024 * 1024) self.it = self.req.iter_content(chunk_size=1024 * 1024)
self.decompressor = lzma.LZMADecompressor(format=lzma.FORMAT_AUTO) self.decompressor = lzma.LZMADecompressor(format=lzma.FORMAT_AUTO)
self.eof = False self.eof = False

Loading…
Cancel
Save