1
0
Fork 0
forked from github/pelican

Merge pull request #3223 from offbyone/switch-to-ruff

This commit is contained in:
Justin Mayer 2023-10-28 22:38:26 +02:00 committed by GitHub
commit 269751b033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 38 deletions

View file

@ -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