diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 07281de43f..3f8c3d3a1a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,6 +44,7 @@ jobs: - "!crates/ruff_shrinking/**" - scripts/* - .github/workflows/ci.yaml + - python/** formatter: - Cargo.toml @@ -58,6 +59,7 @@ jobs: - crates/ruff_python_parser/** - crates/ruff_dev/** - scripts/* + - python/** - .github/workflows/ci.yaml cargo-fmt: diff --git a/python/ruff-ecosystem/ruff_ecosystem/projects.py b/python/ruff-ecosystem/ruff_ecosystem/projects.py index d4764c34bf..d4fb64e804 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/projects.py +++ b/python/ruff-ecosystem/ruff_ecosystem/projects.py @@ -71,7 +71,12 @@ class CheckOptions(CommandOptions): max_lines_per_rule: int | None = 50 def to_ruff_args(self) -> list[str]: - args = ["check", "--no-cache", "--exit-zero"] + args = [ + "check", + "--no-cache", + "--exit-zero", + f"--{'' if self.preview else 'no-'}preview", + ] if self.select: args.extend(["--select", self.select]) if self.ignore: @@ -80,8 +85,6 @@ class CheckOptions(CommandOptions): args.extend(["--exclude", self.exclude]) if self.show_fixes: args.extend(["--show-fixes", "--ecosystem-ci"]) - if self.preview: - args.append("--preview") return args @@ -95,11 +98,9 @@ class FormatOptions(CommandOptions): exclude: str = "" def to_ruff_args(self) -> list[str]: - args = ["format"] + args = ["format", f"--{'' if self.preview else 'no-'}preview"] if self.exclude: args.extend(["--exclude", self.exclude]) - if self.preview: - args.append("--preview") return args def to_black_args(self) -> list[str]: