File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,15 +37,15 @@ endif
3737 $(VENV_BIN)/python -m pytest -vv ./test
3838
3939lint : requirements # # Apply autoformatting and linting rules
40+ $(VENV_BIN ) /black src_py test
4041 $(VENV_BIN ) /ruff check src_py test
41- $(VENV_BIN ) /ruff format src_py test
4242 -$(VENV_BIN ) /mypy src_py test
4343
4444check : requirements
4545 $(VENV_BIN ) /ruff check src_py test --verbose
4646
4747format : requirements
48- $(VENV_BIN ) /ruff format src_py test
48+ $(VENV_BIN ) /black src_py test
4949
5050CAPI_ENV_FILE =.cache/lbug-capi.env
5151
Original file line number Diff line number Diff line change @@ -53,3 +53,19 @@ Override the source tree location when needed:
5353``` bash
5454make build-pybind-subdir LBUG_SOURCE_DIR=/path/to/ladybug
5555```
56+
57+ ## Formatting
58+
59+ Code is formatted with ** black** and linted with ** ruff** :
60+
61+ ``` bash
62+ make lint # black + ruff check + mypy
63+ make format # black only
64+ make check # ruff check only (verbose)
65+ ```
66+
67+ We also have a pre-commit hook for formatting and linting:
68+
69+ ``` bash
70+ uv run --no-sync pre-commit install
71+ ```
Original file line number Diff line number Diff line change @@ -24,10 +24,12 @@ dev = [
2424 " pytest" ,
2525 " pytest-asyncio~=1.0" ,
2626 " setuptools~=80.9" ,
27- " ruff==0.11.12" ,
27+ " black==26.3.0" ,
28+ " ruff==0.15.18" ,
2829 " mypy==1.16.0" ,
2930 " torch>=2.5.0" ,
3031 " torch-geometric>=2.5.0" ,
32+ " pre-commit>=4.6.0" ,
3133]
3234
3335[[tool .uv .index ]]
You can’t perform that action at this time.
0 commit comments