Skip to content

Commit

Permalink
build(deps): Add back black
Browse files Browse the repository at this point in the history
ruff doesn't replace black, yet
  • Loading branch information
tony committed May 28, 2023
1 parent b1923a8 commit 2cafb7f
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ start_docs:
design_docs:
$(MAKE) -C docs design

black:
poetry run black `${PY_FILES}`

ruff:
ruff .

Expand Down
31 changes: 31 additions & 0 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,36 @@ Rebuild docs and run server via one terminal: `make dev_docs` (requires above, a

## Formatting / Linting

### black

[black] is used for formatting.

````{tab} Command
poetry:
```console
$ poetry run black .
```
If you setup manually:
```console
$ black .
```
````

````{tab} make
```console
$ make black
```
````

In the future, `ruff` (below) may replace black as formatter.

### ruff

The project uses [ruff] to handles formatting, sorting imports and linting.
Expand Down Expand Up @@ -156,5 +186,6 @@ Update `__version__` in `src/gp_libs.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]: https://ruff.rs
[mypy]: https://mypy-lang.org/
96 changes: 95 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ coverage = "*"
pytest-cov = "*"

### Lint ###
black = "*"
ruff = "*"
mypy = "*"
typing-extensions = { version = "*", python = "^3.7" }
Expand All @@ -85,6 +86,7 @@ docs = [
test = ["pytest", "pytest-rerunfailures", "pytest-watcher"]
coverage = ["codecov", "coverage", "pytest-cov"]
lint = [
"black",
"ruff",
"mypy",
"types-docutils",
Expand Down

0 comments on commit 2cafb7f

Please sign in to comment.