Skip to content

Commit 6cb9971

Browse files
committed
fail ruff format on modification
1 parent 525c558 commit 6cb9971

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/QA.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
pip install -e .[lint,scripts,test,check]
2626
2727
- name: Check ruff
28+
run: inv fix-ruff --args '--check'
2829
run: inv lint-ruff
2930

3031
- name: Check pyright

tasks.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ def coverage(ctx: Context, args: str = "", *, html: bool = False):
4242
report_cov(ctx, html=html)
4343

4444

45-
46-
4745
@task(optional=["args"], help={"args": "ruff additional arguments"})
4846
def lint_ruff(ctx: Context, args: str = "."):
4947
args = args or "." # needed for hatch script
@@ -76,13 +74,12 @@ def checkall(ctx: Context, args: str = ""):
7674
check_pyright(ctx, args)
7775

7876

79-
80-
8177
@task(optional=["args"], help={"args": "ruff additional arguments"})
8278
def fix_ruff(ctx: Context, args: str = "."):
83-
"""fix all ruff rules"""
79+
"""fix ruff formatting"""
8480
args = args or "." # needed for hatch script
85-
ctx.run(f"ruff check --fix {args}", pty=use_pty)
81+
ctx.run("ruff --version", pty=use_pty)
82+
ctx.run(f"ruff format {args}", pty=use_pty)
8683

8784

8885
@task(

0 commit comments

Comments
 (0)