Specify Python version for auto-formatters (#3325)

* chore(isort): specify Python version to be assumed

https://pycqa.github.io/isort/docs/configuration/options#python-version

Default is to assume _any_ Python 3 version could be the target.

* chore(black): specify Python target versions

https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version

* chore(ruff): specify Python version to be assumed

https://docs.astral.sh/ruff/settings/#target-version

* chore: exclude directories from auto-formatting
This commit is contained in:
David Culley 2024-08-04 15:54:14 +02:00 committed by GitHub
parent 37a3f4708a
commit 44380dd62a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 0 deletions

View file

@ -1,4 +1,5 @@
[settings] [settings]
py_version=39
known_first_party=anki,aqt,tests known_first_party=anki,aqt,tests
profile=black profile=black
extend_skip=qt/bundle extend_skip=qt/bundle

2
.ruff.toml Normal file
View file

@ -0,0 +1,2 @@
target-version = "py39"
extend-exclude = ["qt/bundle"]

3
pyproject.toml Normal file
View file

@ -0,0 +1,3 @@
[tool.black]
target-version = ["py39", "py310", "py311", "py312"]
extend-exclude = "qt/bundle"

View file

@ -1,4 +1,5 @@
[settings] [settings]
py_version=39
profile=black profile=black
known_first_party=anki,aqt known_first_party=anki,aqt
extend_skip=aqt/forms,hooks_gen.py extend_skip=aqt/forms,hooks_gen.py