mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Allow config-file overrides in ecosystem checks (#9286)
Adds the ability to override `ruff.toml` or `pyproject.toml` settings per-project during ecosystem checks. Exploring this as a fix for the `setuptools` project error. Also useful for including Jupyter Notebooks in the ecosystem checks, see #9293 Note the remaining `sphinx` project error is resolved in #9294
This commit is contained in:
parent
f8fc309855
commit
57b6a8cedd
6 changed files with 210 additions and 60 deletions
|
@ -28,7 +28,12 @@ from ruff_ecosystem.types import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ruff_ecosystem.projects import CheckOptions, ClonedRepository, Project
|
||||
from ruff_ecosystem.projects import (
|
||||
CheckOptions,
|
||||
ClonedRepository,
|
||||
ConfigOverrides,
|
||||
Project,
|
||||
)
|
||||
|
||||
|
||||
# Matches lines that are summaries rather than diagnostics
|
||||
|
@ -477,25 +482,27 @@ async def compare_check(
|
|||
ruff_baseline_executable: Path,
|
||||
ruff_comparison_executable: Path,
|
||||
options: CheckOptions,
|
||||
config_overrides: ConfigOverrides,
|
||||
cloned_repo: ClonedRepository,
|
||||
) -> Comparison:
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
baseline_task = tg.create_task(
|
||||
ruff_check(
|
||||
executable=ruff_baseline_executable.resolve(),
|
||||
path=cloned_repo.path,
|
||||
name=cloned_repo.fullname,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
comparison_task = tg.create_task(
|
||||
ruff_check(
|
||||
executable=ruff_comparison_executable.resolve(),
|
||||
path=cloned_repo.path,
|
||||
name=cloned_repo.fullname,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
with config_overrides.patch_config(cloned_repo.path, options.preview):
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
baseline_task = tg.create_task(
|
||||
ruff_check(
|
||||
executable=ruff_baseline_executable.resolve(),
|
||||
path=cloned_repo.path,
|
||||
name=cloned_repo.fullname,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
comparison_task = tg.create_task(
|
||||
ruff_check(
|
||||
executable=ruff_comparison_executable.resolve(),
|
||||
path=cloned_repo.path,
|
||||
name=cloned_repo.fullname,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
baseline_output, comparison_output = (
|
||||
baseline_task.result(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue