Skip to content
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

Use github output format for ruff in CI #2786

Merged
merged 10 commits into from
Jan 19, 2024
4 changes: 2 additions & 2 deletions .github/workflows/core_code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
run: |
python ./nerfstudio/scripts/docs/add_nb_tags.py --check
- name: Run Ruff Linter
run: ruff check docs/ nerfstudio/ tests/
run: ruff check docs/ nerfstudio/ tests/ --output-format=github
- name: Run Ruff Formatter
run: ruff format docs/ nerfstudio/ tests/ --check
run: ruff format docs/ nerfstudio/ tests/ --check --output-format=github
- name: Run Pyright
run: |
pyright
Expand Down
12 changes: 7 additions & 5 deletions nerfstudio/scripts/github/run_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def run_github_actions_file(filename: str, continue_on_fail: bool = False):

for step in steps:
if "name" in step and step["name"] in LOCAL_TESTS:
compressed = step["run"].replace("\n", ";").replace("\\", "")
if "ruff check" in compressed:
curr_command = f"{compressed} --fix"
else:
curr_command = compressed.replace("--check", "")
curr_command = step["run"].replace("\n", ";").replace("\\", "")
if curr_command.startswith("ruff"):
if "ruff check" in curr_command:
curr_command = f"{curr_command} --fix"
else:
curr_command = curr_command.replace("--check", "")
curr_command = curr_command.replace(" --output-format=github", "")

CONSOLE.line()
CONSOLE.rule(f"[bold green]Running: {curr_command}")
Expand Down
Loading