Run ecosystem checks with preview mode enabled (#8358)

Until https://github.com/astral-sh/ruff/issues/8076 is ready, it seems
beneficial to get feedback on preview mode changes.

Tested locally, updated logs to output the flags passed to `ruff` and
verified `--preview` is used.
This commit is contained in:
Zanie Blue 2023-11-01 12:12:02 -05:00 committed by GitHub
parent e9acb99f7d
commit 3fc920cd12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 88 additions and 58 deletions

View file

@ -73,6 +73,10 @@ def entrypoint():
ruff_comparison,
)
targets = DEFAULT_TARGETS
if args.force_preview:
targets = [target.with_preview_enabled() for target in targets]
with cache_context as cache:
loop = asyncio.get_event_loop()
main_task = asyncio.ensure_future(
@ -80,7 +84,7 @@ def entrypoint():
command=RuffCommand(args.ruff_command),
ruff_baseline_executable=ruff_baseline,
ruff_comparison_executable=ruff_comparison,
targets=DEFAULT_TARGETS,
targets=targets,
format=OutputFormat(args.output_format),
project_dir=Path(cache),
raise_on_failure=args.pdb,
@ -131,6 +135,11 @@ def parse_args() -> argparse.Namespace:
action="store_true",
help="Enable debugging on failure",
)
parser.add_argument(
"--force-preview",
action="store_true",
help="Force preview mode to be enabled for all projects",
)
parser.add_argument(
"ruff_command",
choices=[option.name for option in RuffCommand],