Skip to content

Commit

Permalink
Added subprocess running ruff after generating masterdata
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Jan 10, 2025
1 parent 33cbc79 commit 29fb9d1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions bam_masterdata/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import subprocess
import time
from pathlib import Path

Expand Down Expand Up @@ -64,12 +65,18 @@ def fill_masterdata(url):
elapsed_time = time.time() - start_time
click.echo(f"Generated all types in {elapsed_time:.2f} seconds\n\n")

# ! this could be automated in the CLI
click.echo(
"Don't forget to apply ruff at the end after generating the files by doing:\n"
)
click.echo(" ruff check .\n")
click.echo(" ruff format .\n")
try:
# Run ruff check
click.echo("Running `ruff check .`...")
subprocess.run(["ruff", "check", "."], check=True)

# Run ruff format
click.echo("Running `ruff format .`...")
subprocess.run(["ruff", "format", "."], check=True)
except subprocess.CalledProcessError as e:
click.echo(f"Error during ruff execution: {e}", err=True)
else:
click.echo("Ruff checks and formatting completed successfully!")


@cli.command(
Expand Down

1 comment on commit 29fb9d1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Skipped Failures Errors Time
1 0 💤 0 ❌ 1 🔥 4.806s ⏱️

Please sign in to comment.