-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
28 lines (22 loc) · 729 Bytes
/
Copy pathtasks.py
File metadata and controls
28 lines (22 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from invoke import task
from pathlib import Path
@task
def check(ctx):
ctx.run(
"cargo clippy --workspace --all-targets --all-features", pty=True, echo=True
)
rdme(ctx, check=True)
format(ctx, check=True)
@task
def rdme(ctx, check=False, force=False):
flags = " --check" if check else ""
if force:
flags += " --force"
ctx.run("cargo rdme" + flags, pty=True, echo=True)
@task
def format(ctx, check=False):
maybe_check = " --check" if check else ""
ctx.run("cargo +nightly fmt --all" + maybe_check, pty=True, echo=True)
ctx.run("tombi format" + maybe_check, pty=True, echo=True)
# TODO: Add this to CI?
ctx.run("ruff format" + maybe_check, pty=True, echo=True)