diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-12-05 23:47:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-05 23:47:11 +0100 |
| commit | 5a9c9ef54115a27a3eac4e39feb133e33870b145 (patch) | |
| tree | 5856ef55af3f29e8f02fd6da38f4dadcf7736123 /src/ci/github-actions | |
| parent | e941e73368866d3ecc98f040d9f1376de7efcdf1 (diff) | |
| parent | 536516f949ff37b0e10eaed835c2d3592d03e576 (diff) | |
| download | rust-5a9c9ef54115a27a3eac4e39feb133e33870b145.tar.gz rust-5a9c9ef54115a27a3eac4e39feb133e33870b145.zip | |
Rollup merge of #133821 - Kobzol:replace-black-with-ruff, r=onur-ozkan
Replace black with ruff in `tidy` `ruff` can both lint and format Python code (in fact, it should be a mostly drop-in replacement for `black` in terms of formatting), so it's not needed to use `black` anymore. This PR removes `black` and replaces it with `ruff`, to get rid of one Python dependency, and also to make Python formatting faster (although that's a small thing). If we decide to merge this, we'll need to "reformat the world" - `ruff` is not perfectly compatible with `black`, and it also looks like `black` was actually ignoring some files before. I tried it locally (`./x test tidy --extra-checks=py:fmt --bless`) and it also reformatted some code in subtrees (e.g. `clippy` or `rustc_codegen_gcc`) - I'm not sure how to handle that.
Diffstat (limited to 'src/ci/github-actions')
| -rwxr-xr-x | src/ci/github-actions/calculate-job-matrix.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ci/github-actions/calculate-job-matrix.py b/src/ci/github-actions/calculate-job-matrix.py index 7de6d5fcd5f..1f994f0ffd2 100755 --- a/src/ci/github-actions/calculate-job-matrix.py +++ b/src/ci/github-actions/calculate-job-matrix.py @@ -7,6 +7,7 @@ be executed on CI. It reads job definitions from `src/ci/github-actions/jobs.yml` and filters them based on the event that happened on CI. """ + import dataclasses import json import logging @@ -94,7 +95,7 @@ def find_run_type(ctx: GitHubCtx) -> Optional[WorkflowRunType]: try_build = ctx.ref in ( "refs/heads/try", "refs/heads/try-perf", - "refs/heads/automation/bors/try" + "refs/heads/automation/bors/try", ) # Unrolled branch from a rollup for testing perf @@ -135,11 +136,15 @@ def calculate_jobs(run_type: WorkflowRunType, job_data: Dict[str, Any]) -> List[ continue jobs.append(job[0]) if unknown_jobs: - raise Exception(f"Custom job(s) `{unknown_jobs}` not found in auto jobs") + raise Exception( + f"Custom job(s) `{unknown_jobs}` not found in auto jobs" + ) return add_base_env(name_jobs(jobs, "try"), job_data["envs"]["try"]) elif isinstance(run_type, AutoRunType): - return add_base_env(name_jobs(job_data["auto"], "auto"), job_data["envs"]["auto"]) + return add_base_env( + name_jobs(job_data["auto"], "auto"), job_data["envs"]["auto"] + ) return [] @@ -161,7 +166,7 @@ def get_github_ctx() -> GitHubCtx: event_name=event_name, ref=os.environ["GITHUB_REF"], repository=os.environ["GITHUB_REPOSITORY"], - commit_message=commit_message + commit_message=commit_message, ) |
