Skip to content

Update isort and black in run_formatters script to Ruff #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/run_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

def install_requirements():
print("\nInstalling requirements...")
return subprocess.run((sys.executable, "-m", "pip", "install", "--upgrade", "isort", "black"))
return subprocess.run((sys.executable, "-m", "pip", "install", "--upgrade", "ruff"))


def run_isort():
print("\nRunning isort...")
return subprocess.run((sys.executable, "-m", "isort", "."))
def run_ruff_fix():
print("\nRunning Ruff check --fix...")
return subprocess.run((sys.executable, "-m", "ruff", "check", "--fix"))


def run_black():
print("\nRunning Black...")
return subprocess.run((sys.executable, "-m", "black", "."))
def run_ruff_format():
print("\nRunning Ruff format...")
return subprocess.run((sys.executable, "-m", "ruff", "format"))


def main():
Expand All @@ -26,8 +26,8 @@ def main():

install_requirements().check_returncode()
results = (
run_isort(),
run_black(),
run_ruff_fix(),
run_ruff_format(),
)
if sum([result.returncode for result in results]) > 0:
print("\nOne or more tests failed. See above for details.")
Expand Down