mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
inv task now uses ruff
This commit is contained in:
parent
7dfc799f25
commit
58fd855385
2 changed files with 12 additions and 4 deletions
|
|
@ -57,6 +57,7 @@ pytest = "^7.1"
|
|||
pytest-cov = "^4.0"
|
||||
pytest-sugar = "^0.9.5"
|
||||
pytest-xdist = "^2.0"
|
||||
ruff = "^0.1.3"
|
||||
tox = {version = "^3.13", optional = true}
|
||||
flake8 = "^3.8"
|
||||
flake8-import-order = "^0.18.1"
|
||||
|
|
|
|||
15
tasks.py
15
tasks.py
|
|
@ -66,13 +66,20 @@ def isort(c, check=False, diff=False):
|
|||
|
||||
|
||||
@task
|
||||
def flake8(c):
|
||||
c.run(f"git diff HEAD | {VENV_BIN}/flake8 --diff --max-line-length=88", pty=PTY)
|
||||
def ruff(c, fix=False, diff=False):
|
||||
"""Run Ruff to ensure code meets project standards."""
|
||||
diff_flag, fix_flag = "", ""
|
||||
if fix:
|
||||
fix_flag = "--fix"
|
||||
if diff:
|
||||
diff_flag = "--diff"
|
||||
c.run(f"{VENV_BIN}/ruff check {diff_flag} {fix_flag} .", pty=PTY)
|
||||
|
||||
|
||||
@task
|
||||
def lint(c):
|
||||
flake8(c)
|
||||
def lint(c, fix=False, diff=False):
|
||||
"""Check code style via linting tools."""
|
||||
ruff(c, fix=fix, diff=diff)
|
||||
|
||||
|
||||
@task
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue