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:
Zanie Blue 2023-12-28 10:44:50 -06:00 committed by GitHub
parent f8fc309855
commit 57b6a8cedd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 210 additions and 60 deletions

View file

@ -1,7 +1,13 @@
"""
Default projects for ecosystem checks
"""
from ruff_ecosystem.projects import CheckOptions, FormatOptions, Project, Repository
from ruff_ecosystem.projects import (
CheckOptions,
ConfigOverrides,
FormatOptions,
Project,
Repository,
)
# TODO(zanieb): Consider exporting this as JSON and loading from there instead
DEFAULT_TARGETS = [
@ -45,7 +51,14 @@ DEFAULT_TARGETS = [
Project(repo=Repository(owner="pypa", name="build", ref="main")),
Project(repo=Repository(owner="pypa", name="cibuildwheel", ref="main")),
Project(repo=Repository(owner="pypa", name="pip", ref="main")),
Project(repo=Repository(owner="pypa", name="setuptools", ref="main")),
Project(
repo=Repository(owner="pypa", name="setuptools", ref="main"),
# Since `setuptools` opts into the "preserve" quote style which
# require preview mode, we must disable it during the `--no-preview` run
config_overrides=ConfigOverrides(
when_no_preview={"format.quote-style": "double"}
),
),
Project(repo=Repository(owner="python", name="mypy", ref="master")),
Project(
repo=Repository(