Skip to content

Commit

Permalink
Add black opts in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Oct 6, 2021
1 parent 366d02a commit 4d71129
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
checkfiles = tortoise/ examples/ tests/ conftest.py
black_opts = -l 100 -t py37
py_warn = PYTHONDEVMODE=1

help:
Expand All @@ -22,7 +21,7 @@ deps:

check: deps build
ifneq ($(shell which black),)
black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
black --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
endif
flake8 $(checkfiles)
mypy $(checkfiles)
Expand All @@ -32,7 +31,7 @@ endif

lint: deps build
ifneq ($(shell which black),)
black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
black --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
endif
flake8 $(checkfiles)
mypy $(checkfiles)
Expand Down Expand Up @@ -68,7 +67,7 @@ docs: deps

style: deps
isort -src $(checkfiles)
black $(black_opts) $(checkfiles)
black $(checkfiles)

build: deps
rm -fR dist/
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ asyncmy = ["asyncmy"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39']

0 comments on commit 4d71129

Please sign in to comment.