Skip to content

Commit 19eb44b

Browse files
Configure ruff and mypy in pyproject.toml (#33)
Co-authored-by: Annika Bätz <annika.baetz@kit.edu>
1 parent 9740da6 commit 19eb44b

2 files changed

Lines changed: 49 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ jobs:
3838
- name: Run ruff format
3939
run: uv run ruff format
4040

41-
- name: Run ruff linter for mdp folder
42-
run: uv run ruff check src/behavior_generation_lecture_python/mdp
41+
- name: Run ruff linter
42+
run:
43+
uv run ruff check
4344

44-
- name: Run mypy for mdp folder
45-
run: uv run mypy src/behavior_generation_lecture_python/mdp
45+
- name: Run mypy
46+
run:
47+
uv run mypy
4648

4749
- name: Test
4850
run: |

pyproject.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,46 @@ docs = [
5151
requires = ["setuptools>=64.0.0", "wheel", "pip>=21.3.0"]
5252
build-backend = "setuptools.build_meta"
5353

54+
[tool.ruff]
55+
# Check src, scripts, and notebooks
56+
include = ["src/**/*.py", "scripts/**/*.py", "notebooks/**/*.ipynb"]
57+
58+
# Exclude files that aren't ready yet
59+
exclude = [
60+
"notebooks/compare_models_notebook.ipynb",
61+
"notebooks/lateral_control_riccati_notebook.ipynb",
62+
"notebooks/lateral_control_state_based_notebook.ipynb",
63+
"scripts/run_compare_dynamic_one_track_models.py",
64+
"scripts/run_lateral_control_riccati.py",
65+
"scripts/run_lateral_control_state_based.py",
66+
"src/behavior_generation_lecture_python/finite_state_machine/traffic_light_visualization.py",
67+
"src/behavior_generation_lecture_python/lateral_control_riccati/lateral_control_riccati.py",
68+
]
69+
70+
[tool.ruff.lint]
71+
# Ignore specific rules globally that are too noisy
72+
ignore = [
73+
"E731", # Do not assign a lambda expression, use a def
74+
]
75+
76+
[tool.mypy]
77+
python_version = "3.12"
78+
strict = false # for now
79+
ignore_missing_imports = true
80+
81+
# Files/folders to check (notebooks are checked by ruff, not mypy)
82+
files = ["src", "scripts"]
83+
84+
# Exclude files/folders that aren't fully typed yet
85+
exclude = [
86+
"src/behavior_generation_lecture_python/finite_state_machine/",
87+
"src/behavior_generation_lecture_python/vehicle_models/",
88+
"src/behavior_generation_lecture_python/graph_search/",
89+
"src/behavior_generation_lecture_python/utils/vizard/",
90+
"src/behavior_generation_lecture_python/utils/grid_plotting.py",
91+
"src/behavior_generation_lecture_python/lateral_control_riccati/lateral_control_riccati.py",
92+
"scripts/run_finite_state_machine_cli.py",
93+
"scripts/run_finite_state_machine_visu.py",
94+
"scripts/run_compare_dynamic_one_track_models.py",
95+
"scripts/run_a_star.py",
96+
]

0 commit comments

Comments
 (0)