From 6d1e0a02c2cbb3405d44944b9cc4b3769a941f93 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 18 Nov 2023 05:05:33 -0600 Subject: [PATCH] docs(developing): Use `ruff format` --- docs/developing.md | 56 ++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/docs/developing.md b/docs/developing.md index e6a00379f..c2b035207 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -54,22 +54,22 @@ Rebuild docs and run server via one terminal: `make dev_docs` (requires above, a ## Linting -### black +### ruff -[black] is used for formatting. +The project uses [ruff] to handles formatting, sorting imports and linting. ````{tab} Command poetry: ```console -$ poetry run black . +$ poetry run ruff ``` If you setup manually: ```console -$ black . +$ ruff . ``` ```` @@ -77,63 +77,61 @@ $ black . ````{tab} make ```console -$ make black +$ make ruff ``` ```` -In the future, `ruff` (below) may replace black as formatter. +````{tab} Watch -### ruff +```console +$ make watch_ruff +``` -The project uses [ruff] to handles formatting, sorting imports and linting. +requires [`entr(1)`]. -````{tab} Command +```` + +````{tab} Fix files poetry: ```console -$ poetry run ruff +$ poetry run ruff . --fix ``` If you setup manually: ```console -$ ruff . +$ ruff . --fix ``` ```` -````{tab} make +#### ruff format -```console -$ make ruff -``` +[ruff format] is used for formatting. -```` +````{tab} Command -````{tab} Watch +poetry: ```console -$ make watch_ruff +$ poetry run ruff format . ``` -requires [`entr(1)`]. - -```` - -````{tab} Fix files - -poetry: +If you setup manually: ```console -$ poetry run ruff . --fix +$ ruff format . ``` -If you setup manually: +```` + +````{tab} make ```console -$ ruff . --fix +$ make format ``` ```` @@ -236,6 +234,6 @@ Update `__version__` in `__about__.py` and `pyproject.toml`:: [poetry]: https://python-poetry.org/ [entr(1)]: http://eradman.com/entrproject/ [`entr(1)`]: http://eradman.com/entrproject/ -[black]: https://github.com/psf/black +[ruff format]: https://docs.astral.sh/ruff/formatter/ [ruff]: https://ruff.rs [mypy]: http://mypy-lang.org/