diff --git a/python/ruff-ecosystem/ruff_ecosystem/defaults.py b/python/ruff-ecosystem/ruff_ecosystem/defaults.py index 472860f5bb..0627d563c0 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/defaults.py +++ b/python/ruff-ecosystem/ruff_ecosystem/defaults.py @@ -1,7 +1,7 @@ """ Default projects for ecosystem checks """ -from ruff_ecosystem.projects import CheckOptions, Project, Repository +from ruff_ecosystem.projects import CheckOptions, Project, Repository, FormatOptions # TODO(zanieb): Consider exporting this as JSON and loading from there instead DEFAULT_TARGETS = [ @@ -22,7 +22,13 @@ DEFAULT_TARGETS = [ check_options=CheckOptions(select="ALL"), ), Project(repo=Repository(owner="commaai", name="openpilot", ref="master")), - Project(repo=Repository(owner="demisto", name="content", ref="master")), + Project( + repo=Repository(owner="demisto", name="content", ref="master"), + format_options=FormatOptions( + # Syntax errors in this file + exclude="Packs/ThreatQ/Integrations/ThreatQ/ThreatQ.py" + ), + ), Project(repo=Repository(owner="docker", name="docker-py", ref="main")), Project(repo=Repository(owner="freedomofpress", name="securedrop", ref="develop")), Project(repo=Repository(owner="fronzbot", name="blinkpy", ref="dev")), diff --git a/python/ruff-ecosystem/ruff_ecosystem/format.py b/python/ruff-ecosystem/ruff_ecosystem/format.py index 473a7aa4e3..686515521e 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/format.py +++ b/python/ruff-ecosystem/ruff_ecosystem/format.py @@ -154,7 +154,7 @@ async def ruff_format( ) -> Sequence[str]: """Run the given ruff binary against the specified path.""" logger.debug(f"Formatting {name} with {executable}") - ruff_args = ["format"] + ruff_args = options.to_cli_args() if diff: ruff_args.append("--diff") @@ -186,6 +186,10 @@ class FormatOptions: Ruff format options. """ + exclude: str = "" + def to_cli_args(self) -> list[str]: - args = ["format", "--diff"] + args = ["format"] + if self.exclude: + args.extend(["--exclude", self.exclude]) return args