beda-software / cookiecutter-beda-software-stack

MIT License
2 stars 0 forks source link

Add linters and autoformatters with autohooks #3

Open ruscoder opened 3 years ago

ruscoder commented 3 years ago

Use pyproject.toml with settings for pylint, black, sort:

[tool.black]
line-length = 100
target-version = ['py38']
exclude = '''
(
  /(
    | \.git
    | \.pytest_cache
    | htmlcov
    | locales
    | resources
    | requirements
    | embed
  )/
)
'''

[tool.autohooks]
mode = "pythonpath"
pre-commit = ["autohooks.plugins.black", "autohooks.plugins.isort"]

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
use_parentheses = true
line_length = 100
default_section = "THIRDPARTY"
known_first_party = ["app"]

And autohooks:

pip3 install autohooks
pip3 install autohooks-plugin-black
pip3 install autohooks-plugin-isort
ruscoder commented 3 years ago

Important note: use 100 as line length