Skip to content

Commit 9d8282a

Browse files
mdbenitoadsharma
authored andcommitted
Use black locally for formatting, document
1 parent 95ce7e5 commit 9d8282a

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ endif
3737
$(VENV_BIN)/python -m pytest -vv ./test
3838

3939
lint: 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

4444
check: requirements
4545
$(VENV_BIN)/ruff check src_py test --verbose
4646

4747
format: requirements
48-
$(VENV_BIN)/ruff format src_py test
48+
$(VENV_BIN)/black src_py test
4949

5050
CAPI_ENV_FILE=.cache/lbug-capi.env
5151

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ Override the source tree location when needed:
5353
```bash
5454
make 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+
```

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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]]

0 commit comments

Comments
 (0)