Skip to content

Commit

Permalink
chore: ruff instead of black
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Feb 22, 2025
1 parent 94124e9 commit cae3172
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
@task
def lint(ctx, fix=False):
in_ci = os.getenv("GITHUB_WORKFLOW")
print("Run mypy:")
ctx.run("mypy --exclude .venv .")
print("Run black:")
black_cmd = ["black", "."]
ruff_format_cmd = ["ruff", "format"]
if in_ci:
black_cmd.insert(1, "--check")
ctx.run(" ".join(black_cmd))
print("Run ruff:")
ruff_format_cmd.append("--check")
ruff_format_cmd.append(".")
print(f"Run ruff format: {ruff_format_cmd}")
ctx.run(" ".join(ruff_format_cmd))
ruff_cmd = "ruff check "
if fix:
if fix and not in_ci:
ruff_cmd = f"{ruff_cmd} --fix"
print(f"Run ruff check: {ruff_cmd}")
ctx.run(ruff_cmd)
print("Run mypy:")
ctx.run("mypy --exclude .venv .")
print(f"Lint Robot files {'in ci' if in_ci else ''}")
cmd = ["robotidy", "atest"]
if in_ci:
Expand Down
6 changes: 3 additions & 3 deletions utest/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ def test_verify_checksum(file: Path, tmp_path: Path):
for kw in source_data:
source_sha256 = source_data[kw]["sha256"]
translation_sha256 = translation_data[kw]["sha256"]
assert (
source_sha256 == translation_sha256
), f"{kw} sha256 was {source_sha256} expected {translation_sha256}"
assert source_sha256 == translation_sha256, (
f"{kw} sha256 was {source_sha256} expected {translation_sha256}"
)

0 comments on commit cae3172

Please sign in to comment.