Move existing linting into flakeheaven (#1628)

* add black and isort to flakeheaven

* update lock file

* clean up poe config

* run formta on python blocks in markdown file

* disable code for black being confused about markdown

* add cache timeout for flakeheaven

See: https://github.com/flakeheaven/flakeheaven/issues/71
This commit is contained in:
Jonathan Wren 2022-10-31 09:31:17 -07:00 committed by GitHub
parent 9150f07984
commit 51e9ce5638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 40 deletions

View file

@ -45,6 +45,8 @@ tzlocal = ">=4.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt
[tool.poetry.dev-dependencies]
black = { version = ">=21.5b2", allow-prereleases = true }
flakeheaven = ">=3.0"
flake8-black = ">=0.3.3"
flake8-isort = ">=5.0.0"
ipdb = "*"
isort = ">=5.10"
mkdocs = ">=1.0,<1.3"
@ -62,26 +64,6 @@ xmltodict = "*"
jrnl = 'jrnl.cli:cli'
[tool.poe.tasks]
format-run = [
{cmd = "black ."},
]
format-check = [
{cmd = "black --version"},
{cmd = "black --check --diff ."},
]
style-check = [
{cmd = "flakeheaven --version"},
{cmd = "flakeheaven plugins"},
{cmd = "flakeheaven lint"},
]
sort-run = [
{cmd = "isort ."},
]
sort-check = [
{cmd = "isort --version"},
{cmd = "isort --check ."},
]
docs-check.default_item_type = "script"
docs-check.sequence = [
"tasks:delete_files(['sitemap.xml', 'config.json'])",
@ -100,22 +82,23 @@ test-run = [
{cmd = "tox -q -e py --"},
]
installer-check = [
{cmd = "poetry --version"},
{cmd = "poetry check"},
# Groups of tasks
format.default_item_type = "cmd"
format.sequence = [
"isort .",
"black .",
]
# Groups of tasks
format = [
"format-run",
"sort-run",
]
lint = [
"installer-check",
"style-check",
"sort-check",
"format-check",
lint.env = { FLAKEHEAVEN_CACHE_TIMEOUT = "0" }
lint.default_item_type = "cmd"
lint.sequence = [
"poetry --version",
"poetry check",
"flakeheaven --version",
"flakeheaven plugins",
"flakeheaven lint",
]
test = [
"lint",
"test-run",
@ -169,6 +152,8 @@ pycodestyle = [
"-E70",
"-W1*", "-W2*", "-W3*", "-W5*",
]
"flake8-*" = ["+*"]
flake8-black = ["-BLK901"]
[build-system]