Skip to content

Commit 6fa2bfb

Browse files
committed
style: apply ruff format to entire codebase
1 parent 00f194d commit 6fa2bfb

90 files changed

Lines changed: 589 additions & 325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/run_full_audit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ def main() -> int:
5252
if artifacts.scores:
5353
print("")
5454
print("Top repositories:")
55-
for item in sorted(artifacts.scores, key=lambda score: score.global_score, reverse=True)[:5]:
55+
for item in sorted(artifacts.scores, key=lambda score: score.global_score, reverse=True)[
56+
:5
57+
]:
5658
print(f" - {item.repo_full_name}: {item.global_score:.2f}/100 ({item.score_label})")
5759

5860
return 0
5961

6062

6163
if __name__ == "__main__":
62-
raise SystemExit(main())
64+
raise SystemExit(main())

src/portfolio_auditor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def __getattr__(name: str) -> Any:
2020
"AuditRunner": AuditRunner,
2121
}
2222
return mapping[name]
23-
raise AttributeError(f"module 'portfolio_auditor' has no attribute {name!r}")
23+
raise AttributeError(f"module 'portfolio_auditor' has no attribute {name!r}")

src/portfolio_auditor/audit_runner.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ def run(
131131
result_index: dict[str, _RepoPipelineResult] = {
132132
r.repo.full_name: r for r in pipeline_results
133133
}
134-
ordered_results = [result_index[repo.full_name] for repo in repos if repo.full_name in result_index]
134+
ordered_results = [
135+
result_index[repo.full_name] for repo in repos if repo.full_name in result_index
136+
]
135137

136138
scans = [r.scan for r in ordered_results]
137139
scores = [r.score for r in ordered_results]
@@ -165,9 +167,7 @@ def run(
165167

166168
return artifacts
167169

168-
def _run_pipeline_parallel(
169-
self, repos: list[RepoMetadata]
170-
) -> list[_RepoPipelineResult]:
170+
def _run_pipeline_parallel(self, repos: list[RepoMetadata]) -> list[_RepoPipelineResult]:
171171
"""
172172
Process each repo (scan → score → review) in a thread pool.
173173
@@ -178,8 +178,7 @@ def _run_pipeline_parallel(
178178

179179
with ThreadPoolExecutor(max_workers=self.max_workers) as executor:
180180
future_to_repo = {
181-
executor.submit(self._process_single_repo, repo): repo
182-
for repo in repos
181+
executor.submit(self._process_single_repo, repo): repo for repo in repos
183182
}
184183
for future in as_completed(future_to_repo):
185184
repo = future_to_repo[future]

src/portfolio_auditor/cli.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def full_run_command(
3737
console.print("[bold red]GitHub API rate limit exceeded.[/bold red]")
3838
console.print(str(exc))
3939
if snapshot_path.exists():
40-
console.print(
41-
f"[yellow]Cached snapshot available:[/yellow] {snapshot_path}"
42-
)
40+
console.print(f"[yellow]Cached snapshot available:[/yellow] {snapshot_path}")
4341
else:
4442
console.print(
4543
"[yellow]No cached snapshot found.[/yellow] "
@@ -73,4 +71,4 @@ def full_run_command(
7371

7472

7573
if __name__ == "__main__":
76-
app()
74+
app()

src/portfolio_auditor/collectors/github/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,4 @@ def get_repo_tree(self, full_name: str, branch: str) -> dict[str, Any]:
313313
return payload
314314

315315
def get_rate_limit(self) -> dict[str, Any]:
316-
return self._request("GET", "/rate_limit")
316+
return self._request("GET", "/rate_limit")

src/portfolio_auditor/collectors/github/collector.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ def _list_owner_repos(self, owner: str) -> tuple[list[dict[str, Any]], str]:
159159
except Exception:
160160
pass
161161

162-
include_private = bool(
163-
authenticated_login and authenticated_login.lower() == owner.lower()
164-
)
162+
include_private = bool(authenticated_login and authenticated_login.lower() == owner.lower())
165163

166164
try:
167165
if include_private:
@@ -334,4 +332,4 @@ def _parse_repo_payload(payload: dict[str, Any]) -> RepoMetadata:
334332
else None
335333
),
336334
readme_download_url=payload.get("readme_download_url"),
337-
)
335+
)

src/portfolio_auditor/collectors/github/language_fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def fetch_languages(owner: str, repo: str, settings: Settings | None = None) ->
1010
try:
1111
return client.get_repo_languages(f"{owner}/{repo}")
1212
finally:
13-
client.close()
13+
client.close()

src/portfolio_auditor/collectors/github/readme_fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def fetch_readme(owner: str, repo: str, settings: Settings | None = None) -> dic
1212
try:
1313
return client.get_repo_readme(f"{owner}/{repo}")
1414
finally:
15-
client.close()
15+
client.close()

src/portfolio_auditor/collectors/github/tree_fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ def fetch_tree(
1717
try:
1818
return client.get_repo_tree(f"{owner}/{repo}", branch)
1919
finally:
20-
client.close()
20+
client.close()

src/portfolio_auditor/dashboard/app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ def main() -> None:
358358
)
359359
if data.comparison_summary.get("snapshot_created_at_utc"):
360360
st.caption(
361-
"Compared with snapshot: "
362-
f"{data.comparison_summary['snapshot_created_at_utc']}"
361+
f"Compared with snapshot: {data.comparison_summary['snapshot_created_at_utc']}"
363362
)
364363

365364
if data.next_actions:
@@ -421,4 +420,4 @@ def main() -> None:
421420

422421

423422
if __name__ == "__main__":
424-
main()
423+
main()

0 commit comments

Comments
 (0)