mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Ruff ecosystem: pass no-preview cli arg by default (#8775)
Addresses https://github.com/astral-sh/ruff/pull/8489#issuecomment-1793513411 That issues still exist on formatter, but since `black` doesn't support `no-preview` cli arg, I didn't include it in this PR. --------- Co-authored-by: Zanie <contact@zanie.dev>
This commit is contained in:
parent
10d937c1a1
commit
aec80dc3ab
2 changed files with 9 additions and 6 deletions
|
@ -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]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue