linter: don't allow implicitly concatenated strings (#23513)
* linter: don't allow implicitly concatenated strings * fix hyundaipull/23515/head
parent
6d5dce2ed5
commit
2c94f15584
|
@ -1,4 +1,8 @@
|
||||||
repos:
|
repos:
|
||||||
|
- repo: meta
|
||||||
|
hooks:
|
||||||
|
- id: check-hooks-apply
|
||||||
|
- id: check-useless-excludes
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.1.0
|
rev: v4.1.0
|
||||||
hooks:
|
hooks:
|
||||||
|
@ -23,9 +27,13 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(selfdrive/debug/)/'
|
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(selfdrive/debug/)/'
|
||||||
|
additional_dependencies: ['flake8-no-implicit-concat']
|
||||||
args:
|
args:
|
||||||
|
- --indent-size=2
|
||||||
|
- --enable-extensions=NIC
|
||||||
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
|
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
|
||||||
- --statistics
|
- --statistics
|
||||||
|
- -j4
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
|
@ -33,7 +41,7 @@ repos:
|
||||||
entry: pylint
|
entry: pylint
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)/'
|
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)'
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: cppcheck
|
- id: cppcheck
|
||||||
|
|
|
@ -463,6 +463,11 @@ known-standard-library=
|
||||||
# Force import order to recognize a module as part of a third party library.
|
# Force import order to recognize a module as part of a third party library.
|
||||||
known-third-party=enchant
|
known-third-party=enchant
|
||||||
|
|
||||||
|
[STRING]
|
||||||
|
|
||||||
|
# This flag controls whether the implicit-str-concat should generate a warning
|
||||||
|
# on implicit string concatenation in sequences defined over several lines.
|
||||||
|
check-str-concat-over-line-jumps=yes
|
||||||
|
|
||||||
[EXCEPTIONS]
|
[EXCEPTIONS]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from cereal import car
|
from cereal import car
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from cereal import car
|
from cereal import car
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
@ -672,7 +670,7 @@ FW_VERSIONS = {
|
||||||
b'\xf1\x00IK MDPS R 1.00 1.07 57700-G9220 4I2VL107',
|
b'\xf1\x00IK MDPS R 1.00 1.07 57700-G9220 4I2VL107',
|
||||||
],
|
],
|
||||||
(Ecu.transmission, 0x7e1, None): [
|
(Ecu.transmission, 0x7e1, None): [
|
||||||
b'\xf1\x87VCJLP18407832DN3\x88vXfvUVT\x97eFU\x87d7v\x88eVeveFU\x89\x98\x7f\xff\xb2\xb0\xf1\x81E25\x00\x00\x00'
|
b'\xf1\x87VCJLP18407832DN3\x88vXfvUVT\x97eFU\x87d7v\x88eVeveFU\x89\x98\x7f\xff\xb2\xb0\xf1\x81E25\x00\x00\x00',
|
||||||
b'\x00\x00\x00\x00\xf1\x00bcsh8p54 E25\x00\x00\x00\x00\x00\x00\x00SIK0T33NB4\xecE\xefL',
|
b'\x00\x00\x00\x00\xf1\x00bcsh8p54 E25\x00\x00\x00\x00\x00\x00\x00SIK0T33NB4\xecE\xefL',
|
||||||
],
|
],
|
||||||
(Ecu.fwdRadar, 0x7d0, None): [
|
(Ecu.fwdRadar, 0x7d0, None): [
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
Ecu = car.CarParams.Ecu
|
Ecu = car.CarParams.Ecu
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from cereal import car
|
from cereal import car
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from cereal import car
|
from cereal import car
|
||||||
from selfdrive.car import dbc_dict
|
from selfdrive.car import dbc_dict
|
||||||
from selfdrive.config import Conversions as CV
|
from selfdrive.config import Conversions as CV
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# flake8: noqa
|
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ def joystick_thread(use_keyboard):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Publishes events from your joystick to control your car.\n'
|
parser = argparse.ArgumentParser(description='Publishes events from your joystick to control your car.\n' +
|
||||||
'openpilot must be offroad before starting joysticked.',
|
'openpilot must be offroad before starting joysticked.',
|
||||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||||
parser.add_argument('--keyboard', action='store_true', help='Use your keyboard instead of a joystick')
|
parser.add_argument('--keyboard', action='store_true', help='Use your keyboard instead of a joystick')
|
||||||
|
@ -85,11 +85,11 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
print()
|
print()
|
||||||
if args.keyboard:
|
if args.keyboard:
|
||||||
print('Gas/brake control: `W` and `S` keys\n'
|
print('Gas/brake control: `W` and `S` keys')
|
||||||
'Steering control: `A` and `D` keys')
|
print('Steering control: `A` and `D` keys')
|
||||||
print('Buttons:\n'
|
print('Buttons')
|
||||||
'- `R`: Resets axes\n'
|
print('- `R`: Resets axes')
|
||||||
'- `C`: Cancel cruise control')
|
print('- `C`: Cancel cruise control')
|
||||||
else:
|
else:
|
||||||
print('Using joystick, make sure to run cereal/messaging/bridge on your device if running over the network!')
|
print('Using joystick, make sure to run cereal/messaging/bridge on your device if running over the network!')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue