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
|
2023-04-14 12:45:12 +08:00
|
|
|
rev: v4.4.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
|
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
|
|
|
|
args: ['--maxkb=100']
|
2022-08-31 02:20:55 +08:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2023-06-21 01:41:21 +08:00
|
|
|
rev: v2.2.5
|
2022-08-31 02:20:55 +08:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
2023-02-15 06:32:08 +08:00
|
|
|
exclude: '^(third_party/)|(body/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_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-08-09 05:12:51 +08:00
|
|
|
- -L bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie
|
2022-08-31 02:20:55 +08:00
|
|
|
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
|
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]
|
2023-07-22 09:36:51 +08:00
|
|
|
args: ['--explicit-package-bases']
|
2023-01-01 13:00:50 +08:00
|
|
|
exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(laika/)|(laika_repo/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/)'
|
2023-08-10 04:26:54 +08:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2023-09-06 03:02:21 +08:00
|
|
|
rev: v0.0.287
|
2020-05-28 11:33:05 +08:00
|
|
|
hooks:
|
2023-08-10 04:26:54 +08:00
|
|
|
- id: ruff
|
2023-08-09 05:24:04 +08:00
|
|
|
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)'
|
2020-06-20 11:39:34 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: cppcheck
|
|
|
|
name: cppcheck
|
|
|
|
entry: cppcheck
|
|
|
|
language: system
|
|
|
|
types: [c++]
|
2023-01-01 13:00:50 +08:00
|
|
|
exclude: '^(third_party/)|(cereal/)|(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
|
|
|
|
exclude: '^(third_party/)|(cereal/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
|
|
|
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
|
2022-10-04 03:26:12 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: test_translations
|
|
|
|
name: test translations
|
|
|
|
entry: selfdrive/ui/tests/test_translations.py
|
|
|
|
language: script
|
|
|
|
pass_filenames: false
|
2022-10-22 07:23:56 +08:00
|
|
|
- repo: https://github.com/python-poetry/poetry
|
2023-08-23 01:39:45 +08:00
|
|
|
rev: '1.6.0'
|
2022-10-22 07:23:56 +08:00
|
|
|
hooks:
|
|
|
|
- id: poetry-check
|
2023-05-27 10:21:34 +08:00
|
|
|
- id: poetry-lock
|
|
|
|
name: validate poetry lock
|
2023-08-23 04:55:23 +08:00
|
|
|
args:
|
2023-05-27 10:21:34 +08:00
|
|
|
- --check
|