Skip to content

Commit 927510f

Browse files
committed
add subcommand for checking format
1 parent 8100c48 commit 927510f

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/QA.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- name: Check Lint and Formatting
2828
run: |
29-
inv format --args '--check'
29+
inv check-format
3030
inv lint
3131
3232
- name: Type Check

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ features = ["scripts", "lint"]
7676
[tool.hatch.envs.lint.scripts]
7777
lint = "inv lint --args '{args}'"
7878
format = "inv format --args '{args}'"
79+
check-format = "inv check-format"
7980
fixall = "inv fixall"
8081

8182
[tool.hatch.envs.check]

tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ def format(ctx: Context, args: str = "."): # noqa: A001
7272
ctx.run(f"ruff format {args}", pty=use_pty)
7373

7474

75+
@task()
76+
def check_format(ctx: Context):
77+
format(ctx, "--check")
78+
79+
7580
@task()
7681
def fixall(ctx: Context):
7782
"""Fix everything automatically"""
78-
lint(ctx, "--select I --fix") # sort imports along with check fixes
83+
lint(ctx, "--select I --fix") # sort imports along with check fixes
7984
format(ctx)

0 commit comments

Comments
 (0)