2023-09-06 07:33:26 +08:00
|
|
|
exclude: '^(tinygrad_repo)'
|
2020-05-28 11:00:14 +08:00
|
|
|
repos:
|
2022-01-14 06:19:38 +08:00
|
|
|
- repo: meta
|
|
|
|
hooks:
|
|
|
|
- id: check-hooks-apply
|
|
|
|
- id: check-useless-excludes
|
2020-05-28 11:00:14 +08:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2024-04-09 02:35:04 +08:00
|
|
|
rev: v4.6.0
|
2020-05-28 11:00:14 +08:00
|
|
|
hooks:
|
|
|
|
- id: check-ast
|
2023-01-01 13:00:50 +08:00
|
|
|
exclude: '^(third_party)/'
|
2020-05-28 11:00:14 +08:00
|
|
|
- id: check-json
|
2024-02-25 12:54:04 +08:00
|
|
|
exclude: '.devcontainer/devcontainer.json|.vscode/' # these support JSON with comments
|
2023-04-14 12:45:12 +08:00
|
|
|
- id: check-toml
|
2020-05-28 11:00:14 +08:00
|
|
|
- id: check-xml
|
|
|
|
- id: check-yaml
|
2020-06-04 03:54:49 +08:00
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: check-symlinks
|
2023-09-06 07:33:26 +08:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-shebang-scripts-are-executable
|
2022-01-13 14:52:58 +08:00
|
|
|
- id: check-added-large-files
|
2023-12-27 07:22:59 +08:00
|
|
|
exclude: '(docs/CARS.md)|(poetry.lock)|(third_party/acados/include/blasfeo/include/blasfeo_d_kernel.h)'
|
2023-09-26 13:22:48 +08:00
|
|
|
args:
|
2023-12-27 07:22:59 +08:00
|
|
|
- --maxkb=120
|
2023-09-26 13:22:48 +08:00
|
|
|
- --enforce-all
|
2022-08-31 02:20:55 +08:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2023-10-04 06:31:26 +08:00
|
|
|
rev: v2.2.6
|
2022-08-31 02:20:55 +08:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(body/)|(msgq/)|(panda/)|(opendbc/)|(rednose/)|(rednose_repo/)|(teleoprtc/)|(teleoprtc_repo/)|(selfdrive/ui/translations/.*.ts)|(poetry.lock)'
|
2022-08-31 02:20:55 +08:00
|
|
|
args:
|
|
|
|
# if you've got a short variable name that's getting flagged, add it here
|
2023-10-04 06:31:26 +08:00
|
|
|
- -L bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints
|
2022-08-31 02:20:55 +08:00
|
|
|
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
|
2024-02-23 10:34:42 +08:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2024-05-13 23:40:23 +08:00
|
|
|
rev: v0.4.4
|
2024-02-23 10:34:42 +08:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(msgq/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
2022-09-28 11:43:05 +08:00
|
|
|
- repo: local
|
2020-05-29 06:05:04 +08:00
|
|
|
hooks:
|
|
|
|
- id: mypy
|
2022-09-28 11:43:05 +08:00
|
|
|
name: mypy
|
|
|
|
entry: mypy
|
|
|
|
language: system
|
|
|
|
types: [python]
|
2024-01-06 07:17:49 +08:00
|
|
|
args:
|
|
|
|
- --local-partial-types
|
|
|
|
- --explicit-package-bases
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(body/)|(msgq/)|(opendbc/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
2020-06-20 11:39:34 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: cppcheck
|
|
|
|
name: cppcheck
|
|
|
|
entry: cppcheck
|
|
|
|
language: system
|
|
|
|
types: [c++]
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(msgq/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(tools/)|(selfdrive/modeld/thneed/debug/)|(selfdrive/modeld/test/)|(selfdrive/camerad/test/)|(installer/)'
|
2020-06-20 11:39:34 +08:00
|
|
|
args:
|
|
|
|
- --error-exitcode=1
|
2020-07-22 18:10:45 +08:00
|
|
|
- --language=c++
|
2020-06-20 11:39:34 +08:00
|
|
|
- --quiet
|
|
|
|
- --force
|
|
|
|
- -j8
|
2023-08-23 04:55:23 +08:00
|
|
|
- repo: https://github.com/cpplint/cpplint
|
|
|
|
rev: 1.6.1
|
|
|
|
hooks:
|
|
|
|
- id: cpplint
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(msgq/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
2023-08-23 04:55:23 +08:00
|
|
|
args:
|
|
|
|
- --quiet
|
|
|
|
- --counting=total
|
|
|
|
- --linelength=240
|
|
|
|
# https://google.github.io/styleguide/cppguide.html
|
|
|
|
# relevant rules are whitelisted, see all options with: cpplint --filter=
|
2023-08-25 01:42:06 +08:00
|
|
|
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
|
2024-02-20 04:11:56 +08:00
|
|
|
- repo: https://github.com/MarcoGorelli/cython-lint
|
2024-04-22 23:42:22 +08:00
|
|
|
rev: v0.16.2
|
2024-02-20 04:11:56 +08:00
|
|
|
hooks:
|
|
|
|
- id: cython-lint
|
2024-06-07 05:31:56 +08:00
|
|
|
exclude: '^(third_party/)|(msgq/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
2024-02-20 04:11:56 +08:00
|
|
|
args:
|
|
|
|
- --max-line-length=240
|
|
|
|
- --ignore=E111, E302, E305
|
2022-10-04 03:26:12 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: test_translations
|
|
|
|
name: test translations
|
2024-06-04 06:48:56 +08:00
|
|
|
entry: pytest selfdrive/ui/tests/test_translations.py
|
|
|
|
language: system
|
2022-10-04 03:26:12 +08:00
|
|
|
pass_filenames: false
|
2024-05-21 07:46:34 +08:00
|
|
|
files: '^selfdrive/ui/translations/'
|
2022-10-22 07:23:56 +08:00
|
|
|
- repo: https://github.com/python-poetry/poetry
|
2024-02-27 01:08:24 +08:00
|
|
|
rev: '1.8.0'
|
2022-10-22 07:23:56 +08:00
|
|
|
hooks:
|
|
|
|
- id: poetry-check
|
2023-05-27 10:21:34 +08:00
|
|
|
name: validate poetry lock
|
2023-08-23 04:55:23 +08:00
|
|
|
args:
|
2023-09-22 08:41:44 +08:00
|
|
|
- --lock
|
2023-09-07 01:40:52 +08:00
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
2024-05-13 23:40:23 +08:00
|
|
|
rev: 0.28.3
|
2023-09-07 01:40:52 +08:00
|
|
|
hooks:
|
|
|
|
- id: check-github-workflows
|