Skip to content

Commit a1a9a0f

Browse files
pre-commit: fix exclude patterns (#23375)
1 parent f2520b6 commit a1a9a0f

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ repos:
1313
rev: v0.910-1
1414
hooks:
1515
- id: mypy
16-
exclude: '^(pyextra)|(cereal)|(rednose)|(panda)|(laika)|(opendbc)|(laika_repo)|(rednose_repo)/'
16+
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)/'
1717
additional_dependencies: ['git+https://github.com/numpy/numpy-stubs', 'types-requests', 'types-atomicwrites',
1818
'types-pycurl']
1919
- repo: https://github.com/PyCQA/flake8
2020
rev: 4.0.1
2121
hooks:
2222
- id: flake8
23-
exclude: '^(pyextra)|(cereal)|(rednose)|(panda)|(laika)|(opendbc)|(laika_repo)|(rednose_repo)|(selfdrive/debug)/'
23+
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(selfdrive/debug/)/'
2424
args:
2525
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
2626
- --statistics
@@ -31,15 +31,15 @@ repos:
3131
entry: pylint
3232
language: system
3333
types: [python]
34-
exclude: '^(pyextra)|(cereal)|(rednose)|(panda)|(laika)|(laika_repo)|(rednose_repo)/'
34+
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)/'
3535
- repo: local
3636
hooks:
3737
- id: cppcheck
3838
name: cppcheck
3939
entry: cppcheck
4040
language: system
4141
types: [c++]
42-
exclude: '^(third_party)|(pyextra)|(cereal)|(opendbc)|(panda)|(tools)|(selfdrive/modeld/thneed/debug)|(selfdrive/modeld/test)|(selfdrive/camerad/test)/|(installer)'
42+
exclude: '^(third_party/)|(pyextra/)|(cereal/)|(opendbc/)|(panda/)|(tools/)|(selfdrive/modeld/thneed/debug/)|(selfdrive/modeld/test/)|(selfdrive/camerad/test/)/|(installer/)'
4343
args:
4444
- --error-exitcode=1
4545
- --language=c++

selfdrive/pandad.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import usb1
55
import time
66
import subprocess
7-
from typing import List, NoReturn
7+
from typing import NoReturn
88
from functools import cmp_to_key
99

1010
from panda import DEFAULT_FW_FN, DEFAULT_H7_FW_FN, MCU_TYPE_H7, Panda, PandaDFU
@@ -30,12 +30,7 @@ def flash_panda(panda_serial : str) -> Panda:
3030

3131
panda_version = "bootstub" if panda.bootstub else panda.get_version()
3232
panda_signature = b"" if panda.bootstub else panda.get_signature()
33-
cloudlog.warning("Panda {} connected, version: {}, signature {}, expected {}".format(
34-
panda_serial,
35-
panda_version,
36-
panda_signature.hex()[:16],
37-
fw_signature.hex()[:16],
38-
))
33+
cloudlog.warning(f"Panda {panda_serial} connected, version: {panda_version}, signature {panda_signature.hex()[:16]}, expected {fw_signature.hex()[:16]}")
3934

4035
if panda.bootstub or panda_signature != fw_signature:
4136
cloudlog.info("Panda firmware out of date, update required")
@@ -72,7 +67,7 @@ def panda_sort_cmp(a : Panda, b : Panda):
7267
# sort by hardware type
7368
if a_type != b_type:
7469
return a_type < b_type
75-
70+
7671
# last resort: sort by serial number
7772
return a.get_usb_serial() < b.get_usb_serial()
7873

0 commit comments

Comments
 (0)