move black configuration from .pre-commit-config.yaml to pyproject.toml

This commit is contained in:
Aminda Suomalainen 2023-10-21 10:10:56 +03:00
parent 1125b69a9e
commit 3788a5c581
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 24 additions and 1 deletions

View File

@ -86,7 +86,8 @@ repos:
rev: 23.10.0 rev: 23.10.0
hooks: hooks:
- id: black - id: black
args: ["--line-length", "79", "--target-version", "py310"] #Refer to pyproject.toml
#args: ["--line-length", "79", "--target-version", "py310"]
#- id: black-jupyter #- id: black-jupyter
- repo: https://github.com/scop/pre-commit-shfmt - repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-1 rev: v3.7.0-1

22
pyproject.toml Normal file
View File

@ -0,0 +1,22 @@
# When changing this file, read also .pre-commit-config.yaml
[tool.black]
line-length = 79
target-version = ['py310']
[tool.mypy]
#python-executable = 'pypy3'
python-version = 3.10
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html
# No need to have it uncommented since 79 is the standard.
#[tool.pylint.format]
#max-line-length = 79
# Not actually used here, see .pre-commit-config.yaml for reorder-python-imports
# that does the same thing.
#[tool.isort]
#profile = "black"
# copy-pasted comments end.