Skip to content

Commit cde9a8e

Browse files
committed
Update plain fix output style to match plain code check
1 parent cfa4ed2 commit cde9a8e

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

plain-code/plain/code/cli.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,32 @@ def fix(ctx: click.Context, path: str, unsafe_fixes: bool, add_noqa: bool) -> No
138138
raise click.UsageError("Cannot use both --unsafe-fixes and --add-noqa")
139139

140140
if unsafe_fixes:
141-
print_event("Ruff fix (with unsafe fixes)")
141+
print_event(
142+
click.style("Ruff lint:", bold=True)
143+
+ click.style(" ruff check --fix --unsafe-fixes", dim=True)
144+
)
142145
result = subprocess.run(
143146
["ruff", "check", path, "--fix", "--unsafe-fixes", *ruff_args]
144147
)
145148
elif add_noqa:
146-
print_event("Ruff fix (add noqa)")
149+
print_event(
150+
click.style("Ruff lint:", bold=True)
151+
+ click.style(" ruff check --add-noqa", dim=True)
152+
)
147153
result = subprocess.run(["ruff", "check", path, "--add-noqa", *ruff_args])
148154
else:
149-
print_event("Ruff fix")
155+
print_event(
156+
click.style("Ruff lint:", bold=True)
157+
+ click.style(" ruff check --fix", dim=True)
158+
)
150159
result = subprocess.run(["ruff", "check", path, "--fix", *ruff_args])
151160

152161
if result.returncode != 0:
153162
sys.exit(result.returncode)
154163

155-
print_event("Ruff format")
164+
print_event(
165+
click.style("Ruff format:", bold=True) + click.style(" ruff format", dim=True)
166+
)
156167
result = subprocess.run(["ruff", "format", path, *ruff_args])
157168
if result.returncode != 0:
158169
sys.exit(result.returncode)
@@ -163,12 +174,19 @@ def fix(ctx: click.Context, path: str, unsafe_fixes: bool, add_noqa: bool) -> No
163174
if biome.needs_update():
164175
ctx.invoke(install)
165176

166-
print_event("Biome format")
167-
168177
args = ["check", path, "--write"]
169178

170179
if unsafe_fixes:
171180
args.append("--unsafe")
181+
print_event(
182+
click.style("Biome:", bold=True)
183+
+ click.style(" biome check --write --unsafe", dim=True)
184+
)
185+
else:
186+
print_event(
187+
click.style("Biome:", bold=True)
188+
+ click.style(" biome check --write", dim=True)
189+
)
172190

173191
result = biome.invoke(*args)
174192

0 commit comments

Comments
 (0)