patchloop 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
patchloop/cli.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import json
5
6
  import signal
6
7
  import sys
7
8
  from pathlib import Path
@@ -16,22 +17,54 @@ from patchloop.build import BuildError, resolve_build_args
16
17
  from patchloop.config import BuildConfig, Config, ConfigError, load_config
17
18
  from patchloop.detect import DetectError
18
19
  from patchloop.fixers.base import LockError
19
- from patchloop.git_ops import GitError
20
+ from patchloop.git_ops import GitError, repo_slug
20
21
  from patchloop.github import GitHubError
21
22
  from patchloop.hints import hint_for
22
23
  from patchloop.images import ImageScanError, parse_scanners
23
24
  from patchloop.models import ExitCode, Severity
24
- from patchloop.report.console import render_fix, render_scan
25
- from patchloop.report.json_out import write_scan_json
25
+ from patchloop.report.console import (
26
+ FixRow,
27
+ ScanRow,
28
+ overall_exit_code,
29
+ render_fix,
30
+ render_fix_summary,
31
+ render_scan,
32
+ render_scan_summary,
33
+ )
34
+ from patchloop.report.json_out import scan_payload, write_scan_json
26
35
  from patchloop.report.sarif import build_sarif, remaining, write_sarif
36
+ from patchloop.report.sarif import merge as merge_sarif
27
37
  from patchloop.runner import FixError, run_fix
28
38
  from patchloop.scanner import resolve_imports, run_scan
39
+ from patchloop.schedule import (
40
+ ScheduleError,
41
+ check_cron,
42
+ cron_for,
43
+ describe,
44
+ find_target,
45
+ workflow_text,
46
+ write_workflow,
47
+ )
29
48
  from patchloop.sources.base import SourceError
49
+ from patchloop.targets import Target, TargetError
50
+ from patchloop.targets import select as select_targets
30
51
  from patchloop.worktree import WorktreeError
31
52
 
32
53
  app = typer.Typer(
33
54
  name="patchloop",
34
- help="Scan a Python project for vulnerable dependencies, fix them, test, rescan, open one PR.",
55
+ help="Fix vulnerable dependencies in Python and JavaScript projects: upgrade, test, "
56
+ "rescan, and open one pull request.",
57
+ epilog=(
58
+ "What do you want to do?\n\n"
59
+ " Check my setup ............. patchloop doctor\n\n"
60
+ " See what is vulnerable ..... patchloop scan\n\n"
61
+ " Preview the fixes .......... patchloop fix --dry-run\n\n"
62
+ " Fix on a local branch ...... patchloop fix --no-push\n\n"
63
+ " Fix and open a PR .......... patchloop fix\n\n"
64
+ " Run it every week on GitHub patchloop schedule\n\n"
65
+ "Run `patchloop COMMAND --help` for a command's options. "
66
+ "Docs: https://ayushsingh012.github.io/PatchLoop/"
67
+ ),
35
68
  no_args_is_help=True,
36
69
  add_completion=False,
37
70
  )
@@ -42,6 +75,26 @@ PathArg = Annotated[
42
75
  Path,
43
76
  typer.Argument(exists=True, file_okay=False, resolve_path=True, help="Project directory."),
44
77
  ]
78
+ PathsArg = Annotated[
79
+ list[Path] | None,
80
+ typer.Argument(
81
+ exists=True,
82
+ file_okay=False,
83
+ resolve_path=True,
84
+ show_default=False,
85
+ help="Project folder(s). Default: this folder.",
86
+ ),
87
+ ]
88
+ AllOpt = Annotated[
89
+ bool,
90
+ typer.Option(
91
+ "--all", help="Every project found in the folder(s), including ones inside projects."
92
+ ),
93
+ ]
94
+ SkipOpt = Annotated[
95
+ list[str] | None,
96
+ typer.Option("--skip", help="Leave out this project folder, e.g. legacy/app. Repeatable."),
97
+ ]
45
98
  ImportOpt = Annotated[
46
99
  list[Path] | None,
47
100
  typer.Option(
@@ -116,7 +169,7 @@ def main(
116
169
  typer.Option("--version", callback=_version_callback, is_eager=True, help="Show version."),
117
170
  ] = False,
118
171
  ) -> None:
119
- """PatchLoop v1."""
172
+ """PatchLoop: fix vulnerable dependencies, test, rescan, open one PR."""
120
173
  # A kill (SIGTERM) unwinds like Ctrl+C, so the temporary worktree is removed and a
121
174
  # running install or test command is stopped with it.
122
175
  signal.signal(signal.SIGTERM, _exit_on_sigterm)
@@ -126,9 +179,12 @@ def _exit_on_sigterm(signum: int, frame: object) -> NoReturn:
126
179
  raise SystemExit(128 + signum)
127
180
 
128
181
 
129
- @app.command("doctor")
182
+ @app.command(
183
+ "doctor",
184
+ epilog="Run this first on a new machine. Exit code 2 means a required tool is missing.",
185
+ )
130
186
  def doctor_cmd(path: PathArg = Path(), config: ConfigOpt = None) -> None:
131
- """Check the tools PatchLoop uses, and show how to install any that are missing."""
187
+ """Check that the tools PatchLoop needs are installed, and how to install any missing."""
132
188
  cfg = _load_config_or_exit(path, config)
133
189
  if sys.platform == "win32":
134
190
  err_console.print(
@@ -248,9 +304,155 @@ def parse_severity_option(value: str | None) -> set[Severity] | None:
248
304
  return wanted or None
249
305
 
250
306
 
251
- @app.command("scan")
307
+ _STOPS = (
308
+ ConfigError,
309
+ DetectError,
310
+ SourceError,
311
+ ImageScanError,
312
+ BuildError,
313
+ WorktreeError,
314
+ FixError,
315
+ LockError,
316
+ GitError,
317
+ GitHubError,
318
+ )
319
+
320
+
321
+ def _targets(
322
+ paths: list[Path] | None, all_projects: bool, skip: list[str] | None, *, expand: bool
323
+ ) -> list[Target]:
324
+ try:
325
+ targets = select_targets(
326
+ paths or [Path()], all_projects=all_projects, expand=expand, skip=skip
327
+ )
328
+ except TargetError as exc:
329
+ _fail(exc)
330
+ return targets
331
+
332
+
333
+ def _project_config(path: Path, file: Path | None, min_severity: str | None) -> Config:
334
+ return with_min_severity(load_config(path, file), min_severity)
335
+
336
+
337
+ def _scan_many(
338
+ targets: list[Target],
339
+ severity: str | None,
340
+ min_severity: str | None,
341
+ config: Path | None,
342
+ json_out: Path | None,
343
+ sarif_out: Path | None,
344
+ ) -> NoReturn:
345
+ only = parse_severity_option(severity)
346
+ rows: list[ScanRow] = []
347
+ for t in targets:
348
+ err_console.print(f"[dim]Scanning {t.label}…[/dim]", highlight=False)
349
+ try:
350
+ cfg = _project_config(t.path, config, min_severity)
351
+ result = run_scan(t.path, cfg, only, imports=resolve_imports(t.path, cfg, None))
352
+ except _STOPS as exc:
353
+ rows.append(ScanRow(t.label, error=str(exc)))
354
+ continue
355
+ rows.append(ScanRow(t.label, result))
356
+ render_scan_summary(rows, console)
357
+ if json_out is not None:
358
+ projects = [
359
+ {"project": r.label, **scan_payload(r.result)}
360
+ if r.result
361
+ else {"project": r.label, "error": r.error}
362
+ for r in rows
363
+ ]
364
+ json_out.write_text(json.dumps({"projects": projects}, indent=2) + "\n", "utf-8")
365
+ console.print(f"JSON report: {json_out}")
366
+ if sarif_out is not None:
367
+ payloads = []
368
+ for r in rows:
369
+ if r.result is not None:
370
+ lock = r.result.project.lockfile
371
+ payloads.append(build_sarif(r.result.shown, lock, lockfile_uri(lock)))
372
+ write_sarif(merge_sarif(payloads), sarif_out)
373
+ console.print(f"SARIF report: {sarif_out}")
374
+ raise typer.Exit(overall_exit_code([r.exit_code for r in rows]))
375
+
376
+
377
+ def _fix_many(
378
+ targets: list[Target],
379
+ severity: str | None,
380
+ min_severity: str | None,
381
+ config: Path | None,
382
+ json_out: Path | None,
383
+ sarif_out: Path | None,
384
+ *,
385
+ dry_run: bool,
386
+ no_push: bool,
387
+ keep_worktree: bool,
388
+ ) -> NoReturn:
389
+ only = parse_severity_option(severity)
390
+ rows: list[FixRow] = []
391
+ for i, t in enumerate(targets, 1):
392
+ console.rule(f"{t.label} ({i}/{len(targets)})")
393
+ try:
394
+ cfg = _project_config(t.path, config, min_severity)
395
+ outcome = run_fix(
396
+ t.path, cfg, only, dry_run=dry_run, push_pr=not no_push,
397
+ keep_worktree=keep_worktree, imports=resolve_imports(t.path, cfg, None),
398
+ ) # fmt: skip
399
+ except _STOPS as exc:
400
+ err_console.print(f"[red]Error:[/red] {exc}", highlight=False)
401
+ hint = hint_for(exc)
402
+ if hint:
403
+ err_console.print(f"[yellow]Fix:[/yellow] {hint}", highlight=False)
404
+ rows.append(FixRow(t.label, error=str(exc)))
405
+ continue
406
+ render_fix(outcome, console)
407
+ rows.append(FixRow(t.label, outcome))
408
+ console.rule("Summary")
409
+ render_fix_summary(rows, console)
410
+ if json_out is not None:
411
+ projects = [
412
+ {
413
+ "project": r.label,
414
+ "report": json.loads(r.outcome.report.model_dump_json())
415
+ if r.outcome and r.outcome.report
416
+ else None,
417
+ "error": r.error or None,
418
+ }
419
+ for r in rows
420
+ ]
421
+ json_out.write_text(json.dumps({"projects": projects}, indent=2) + "\n", "utf-8")
422
+ console.print(f"JSON report: {json_out}")
423
+ if sarif_out is not None:
424
+ payloads = []
425
+ for r in rows:
426
+ report = r.outcome.report if r.outcome else None
427
+ if r.outcome is None or report is None or r.outcome.scan is None:
428
+ continue
429
+ every = {f.key: f for f in [*report.findings_after, *report.findings_before]}
430
+ still_open = remaining(list(every.values()), report.results)
431
+ lock = r.outcome.scan.project.lockfile
432
+ statuses = {x.finding_key: x for x in report.results}
433
+ payloads.append(build_sarif(still_open, lock, lockfile_uri(lock), statuses))
434
+ write_sarif(merge_sarif(payloads), sarif_out)
435
+ console.print(f"SARIF report: {sarif_out}")
436
+ raise typer.Exit(overall_exit_code([r.exit_code for r in rows]))
437
+
438
+
439
+ @app.command(
440
+ "scan",
441
+ epilog=(
442
+ "Examples:\n\n"
443
+ " patchloop scan HIGH and CRITICAL findings in this folder\n\n"
444
+ " patchloop scan --min-severity LOW every finding\n\n"
445
+ " patchloop scan apps/web --json r.json\n\n"
446
+ " patchloop scan --image myapp:latest also scan a container image\n\n"
447
+ " patchloop scan in a folder of repos: every project in it\n\n"
448
+ " patchloop scan server client just these project folders\n\n"
449
+ "Exit code: 0 nothing found, 1 findings, 2 error."
450
+ ),
451
+ )
252
452
  def scan_cmd(
253
- path: PathArg = Path(),
453
+ paths: PathsArg = None,
454
+ all_projects: AllOpt = False,
455
+ skip: SkipOpt = None,
254
456
  imports: ImportOpt = None,
255
457
  image: ImageOpt = None,
256
458
  scanner: ScannerOpt = None,
@@ -264,7 +466,13 @@ def scan_cmd(
264
466
  json_out: Annotated[Path | None, typer.Option("--json", help="Write a JSON report.")] = None,
265
467
  sarif_out: Annotated[Path | None, typer.Option("--sarif", help="Write a SARIF report.")] = None,
266
468
  ) -> None:
267
- """Collect, merge and prioritize findings. Changes nothing."""
469
+ """Show which dependencies are vulnerable. Changes nothing."""
470
+ targets = _targets(paths, all_projects, skip, expand=True)
471
+ if len(targets) > 1:
472
+ if imports or image or build or dockerfile or build_arg:
473
+ _fail("--import, --image and --build work on one project at a time")
474
+ _scan_many(targets, severity, min_severity, config, json_out, sarif_out)
475
+ path = targets[0].path
268
476
  cfg = with_images(
269
477
  with_min_severity(_load_config_or_exit(path, config), min_severity),
270
478
  image,
@@ -292,9 +500,24 @@ def scan_cmd(
292
500
  raise typer.Exit(ExitCode.FINDINGS_REMAIN)
293
501
 
294
502
 
295
- @app.command("fix")
503
+ @app.command(
504
+ "fix",
505
+ epilog=(
506
+ "Examples:\n\n"
507
+ " patchloop fix --dry-run show the planned upgrades; change nothing\n\n"
508
+ " patchloop fix --no-push upgrade, test, rescan; commit to a local branch only\n\n"
509
+ " patchloop fix the same, then open or update the pull request\n\n"
510
+ " patchloop fix backend a project in a subfolder (each folder gets its own PR)\n\n"
511
+ " patchloop fix --all every project in the folder, one PR each\n\n"
512
+ " patchloop fix --all --skip legacy all but some\n\n"
513
+ "Your own checkout is never touched: the work happens in a temporary copy. "
514
+ "Exit code: 0 nothing left to fix, 1 findings remain, 2 error."
515
+ ),
516
+ )
296
517
  def fix_cmd(
297
- path: PathArg = Path(),
518
+ paths: PathsArg = None,
519
+ all_projects: AllOpt = False,
520
+ skip: SkipOpt = None,
298
521
  imports: ImportOpt = None,
299
522
  image: ImageOpt = None,
300
523
  scanner: ScannerOpt = None,
@@ -322,7 +545,16 @@ def fix_cmd(
322
545
  Path | None, typer.Option("--sarif", help="Write the findings still open as SARIF.")
323
546
  ] = None,
324
547
  ) -> None:
325
- """Full loop in a temporary worktree, then open or update the one PR."""
548
+ """Upgrade vulnerable dependencies, run your tests, rescan, and open one PR."""
549
+ targets = _targets(paths, all_projects, skip, expand=False)
550
+ if len(targets) > 1:
551
+ if imports or image or build or dockerfile or build_arg:
552
+ _fail("--import, --image and --build work on one project at a time")
553
+ _fix_many(
554
+ targets, severity, min_severity, config, json_out, sarif_out,
555
+ dry_run=dry_run, no_push=no_push, keep_worktree=keep_worktree,
556
+ ) # fmt: skip
557
+ path = targets[0].path
326
558
  cfg = with_images(
327
559
  with_min_severity(_load_config_or_exit(path, config), min_severity),
328
560
  image,
@@ -368,3 +600,70 @@ def fix_cmd(
368
600
  write_sarif(build_sarif(still_open, lock, lockfile_uri(lock), statuses), sarif_out)
369
601
  console.print(f"SARIF report: {sarif_out}")
370
602
  raise typer.Exit(outcome.exit_code)
603
+
604
+
605
+ @app.command(
606
+ "schedule",
607
+ epilog=(
608
+ "Examples:\n\n"
609
+ " patchloop schedule every Monday at 06:00 UTC\n\n"
610
+ " patchloop schedule --every day --at 22:00\n\n"
611
+ ' patchloop schedule apps/web --cron "0 6 * * 1-5"\n\n'
612
+ "It only writes the workflow file; commit and push it to start the schedule."
613
+ ),
614
+ )
615
+ def schedule_cmd(
616
+ path: PathArg = Path(),
617
+ every: Annotated[
618
+ str, typer.Option("--every", help="How often: day, week or month (the 1st).")
619
+ ] = "week",
620
+ day: Annotated[str, typer.Option("--day", help="Weekday for --every week.")] = "mon",
621
+ at: Annotated[str, typer.Option("--at", help="Time of day, HH:MM in UTC.")] = "06:00",
622
+ cron: Annotated[
623
+ str | None, typer.Option("--cron", help="A cron line instead, e.g. '0 6 * * 1' (UTC).")
624
+ ] = None,
625
+ min_severity: MinSeverityOpt = None,
626
+ force: Annotated[bool, typer.Option("--force", help="Replace an existing workflow.")] = False,
627
+ ) -> None:
628
+ """Run PatchLoop on a schedule on GitHub's servers (writes a workflow file)."""
629
+ if min_severity is not None:
630
+ try:
631
+ Severity(min_severity.upper())
632
+ except ValueError:
633
+ _fail(f"--min-severity must be LOW, MEDIUM, HIGH or CRITICAL, not '{min_severity}'")
634
+ try:
635
+ line = check_cron(cron) if cron else cron_for(every, day, at)
636
+ target = find_target(path)
637
+ written = write_workflow(
638
+ target, workflow_text(line, target.project_rel, min_severity), force
639
+ )
640
+ except ScheduleError as exc:
641
+ _fail(exc)
642
+ rel = written.relative_to(target.repo_root).as_posix()
643
+ try:
644
+ slug = repo_slug(target.repo_root)
645
+ except GitError:
646
+ slug = "OWNER/REPO"
647
+ console.print(f"Wrote {rel}: PatchLoop will run {describe(line)}.", highlight=False)
648
+ console.print("\nNext steps:", highlight=False)
649
+ console.print(
650
+ f"1. Commit and push it: git add {rel} && git commit -m 'Run PatchLoop on a schedule'"
651
+ " && git push",
652
+ highlight=False,
653
+ )
654
+ console.print(
655
+ "2. Once per repo, let GitHub Actions open pull requests: Settings > Actions > General"
656
+ " > Workflow permissions > 'Allow GitHub Actions to create and approve pull requests'"
657
+ f"\n (or: gh api -X PUT repos/{slug}/actions/permissions/workflow"
658
+ " -F can_approve_pull_request_reviews=true)",
659
+ highlight=False,
660
+ )
661
+ console.print(
662
+ f"3. To run it now: gh workflow run {written.name} (or the Actions tab)",
663
+ highlight=False,
664
+ )
665
+ console.print(
666
+ "Optional: PRs opened with the default token don't start your CI; see the README"
667
+ " ('Run it on a schedule') to pass a token that does.",
668
+ highlight=False,
669
+ )
patchloop/detect.py CHANGED
@@ -61,7 +61,7 @@ def _not_a_project(root: Path, what: str) -> DetectError:
61
61
  listed = ", ".join(below[:10]) + (f" and {len(below) - 10} more" if len(below) > 10 else "")
62
62
  return DetectError(
63
63
  f"{what} in {root}; it holds separate projects: {listed}. "
64
- "Run PatchLoop on each folder (each gets its own PR)"
64
+ "Name one (each gets its own PR), or use --all for every one"
65
65
  )
66
66
  return DetectError(f"{what} in {root}")
67
67
 
patchloop/github.py CHANGED
@@ -82,6 +82,8 @@ class GhCli:
82
82
  f"cannot open {self.slug} on GitHub",
83
83
  )
84
84
  permission = json.loads(out).get("viewerPermission", "")
85
+ if not permission and not self.user and os.environ.get("GITHUB_ACTIONS") == "true":
86
+ return # a workflow token has no "viewer"; the workflow's permissions decide
85
87
  if permission not in _CAN_PUSH:
86
88
  who = self.user or "the active gh account"
87
89
  raise GitHubError(
patchloop/hints.py CHANGED
@@ -25,7 +25,12 @@ _CREDENTIALS = (
25
25
 
26
26
  # (error type, text in the message or "" for any, hint). First match wins.
27
27
  _HINTS: list[tuple[type[Exception], str, str]] = [
28
- (ConfigError, "", "fix patchloop.yml; the README lists every key and its default"),
28
+ (
29
+ ConfigError,
30
+ "",
31
+ "fix patchloop.yml; every key and its default: "
32
+ "https://ayushsingh012.github.io/PatchLoop/configuration/",
33
+ ),
29
34
  (BuildError, "no value", "export the build arg's value first, or pass --build-arg NAME=VALUE"),
30
35
  (BuildError, "no Dockerfile", "pass --dockerfile path/to/Dockerfile (relative to the project)"),
31
36
  (BuildError, "not installed", "install Docker and start it, then run `patchloop doctor`"),
@@ -53,7 +58,8 @@ _HINTS: list[tuple[type[Exception], str, str]] = [
53
58
  (
54
59
  DetectError,
55
60
  "separate projects",
56
- "run it once per folder, e.g. `patchloop fix backend`; each folder gets its own PR branch",
61
+ "`patchloop fix --all` fixes every project (one PR each), or name one: "
62
+ "`patchloop fix backend`",
57
63
  ),
58
64
  (
59
65
  DetectError,
@@ -3,11 +3,12 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from collections import Counter
6
+ from dataclasses import dataclass
6
7
 
7
8
  from rich.console import Console
8
9
  from rich.table import Table
9
10
 
10
- from patchloop.models import Finding, FixStatus, Severity
11
+ from patchloop.models import ExitCode, Finding, FixStatus, Severity
11
12
  from patchloop.runner import FixOutcome
12
13
  from patchloop.scanner import ScanResult
13
14
  from patchloop.versions import is_major_upgrade
@@ -241,3 +242,116 @@ def render_publish(outcome: FixOutcome, console: Console) -> None:
241
242
  console.print(f"[yellow]{outcome.pr_note}[/yellow]")
242
243
  for warning in outcome.warnings:
243
244
  console.print(f"[yellow]Warning: {warning}[/yellow]")
245
+
246
+
247
+ # --- several projects in one run ---------------------------------------------------------
248
+
249
+
250
+ @dataclass
251
+ class ScanRow:
252
+ label: str
253
+ result: ScanResult | None = None
254
+ error: str = ""
255
+
256
+ @property
257
+ def exit_code(self) -> int:
258
+ if self.error:
259
+ return ExitCode.ERROR
260
+ return ExitCode.FINDINGS_REMAIN if self.result and self.result.shown else ExitCode.OK
261
+
262
+
263
+ @dataclass
264
+ class FixRow:
265
+ label: str
266
+ outcome: FixOutcome | None = None
267
+ error: str = ""
268
+
269
+ @property
270
+ def exit_code(self) -> int:
271
+ if self.error or self.outcome is None:
272
+ return ExitCode.ERROR
273
+ return int(self.outcome.exit_code)
274
+
275
+
276
+ def overall_exit_code(codes: list[int]) -> int:
277
+ """2 if any project failed, else 1 if findings remain anywhere, else 0."""
278
+ for code in (ExitCode.ERROR, ExitCode.FINDINGS_REMAIN):
279
+ if code in codes:
280
+ return int(code)
281
+ return int(ExitCode.OK)
282
+
283
+
284
+ def _short(text: str, limit: int = 90) -> str:
285
+ line = text.strip().splitlines()[0] if text.strip() else ""
286
+ return line if len(line) <= limit else line[: limit - 1] + "…"
287
+
288
+
289
+ def render_scan_summary(rows: list[ScanRow], console: Console) -> None:
290
+ table = Table(title=f"{len(rows)} projects", header_style="bold", title_justify="left")
291
+ table.add_column("Project", overflow="fold")
292
+ table.add_column("Type")
293
+ for name in ("Findings", "Critical", "High", "Medium", "Low"):
294
+ table.add_column(name, justify="right")
295
+ table.add_column("Note", overflow="fold")
296
+ for row in rows:
297
+ if row.result is None:
298
+ table.add_row(row.label, "", "", "", "", "", "", f"[red]{_short(row.error)}[/red]")
299
+ continue
300
+ shown = row.result.shown
301
+ counts = Counter(f.severity for f in shown)
302
+ cells = [
303
+ str(counts.get(s, 0) or "")
304
+ for s in (Severity.CRITICAL, Severity.HIGH, Severity.MEDIUM, Severity.LOW)
305
+ ]
306
+ table.add_row(
307
+ row.label,
308
+ row.result.project.manager,
309
+ str(len(shown)),
310
+ *cells,
311
+ "" if shown else "[green]clean[/green]",
312
+ )
313
+ console.print(table)
314
+ with_findings = sum(1 for r in rows if r.result and r.result.shown)
315
+ errors = sum(1 for r in rows if r.error)
316
+ console.print(
317
+ f"{with_findings} with findings · {len(rows) - with_findings - errors} clean"
318
+ + (f" · {errors} failed" if errors else "")
319
+ )
320
+ console.print("[dim]Details for one project: patchloop scan <folder>[/dim]")
321
+
322
+
323
+ def _fix_result(outcome: FixOutcome) -> str:
324
+ if outcome.dry_run or outcome.report is None:
325
+ return f"dry run: {len(outcome.resolvable)} upgrade(s) planned"
326
+ pr = outcome.pr
327
+ if outcome.pr_action in ("created", "updated", "unchanged") and pr is not None:
328
+ word = {"created": "opened", "updated": "updated", "unchanged": "already up to date"}
329
+ return f"PR #{pr.number} {word[outcome.pr_action]}: {pr.url}"
330
+ if outcome.pr_action == "local":
331
+ return f"local branch {outcome.branch}"
332
+ return _short(outcome.pr_note) or "nothing to change"
333
+
334
+
335
+ def render_fix_summary(rows: list[FixRow], console: Console) -> None:
336
+ table = Table(title=f"{len(rows)} projects", header_style="bold", title_justify="left")
337
+ table.add_column("Project", overflow="fold")
338
+ table.add_column("Fixed", justify="right")
339
+ table.add_column("Left", justify="right")
340
+ table.add_column("Result", overflow="fold")
341
+ for row in rows:
342
+ if row.outcome is None:
343
+ table.add_row(row.label, "", "", f"[red]{_short(row.error)}[/red]")
344
+ continue
345
+ report = row.outcome.report
346
+ results = report.results if report else []
347
+ fixed = sum(1 for r in results if r.status.counts_as_fixed)
348
+ left = sum(
349
+ 1 for r in results if not r.status.counts_as_fixed and r.status is not FixStatus.SKIPPED
350
+ )
351
+ table.add_row(
352
+ row.label,
353
+ str(fixed) if report else "",
354
+ str(left) if report else "",
355
+ _fix_result(row.outcome),
356
+ )
357
+ console.print(table)
@@ -4,12 +4,17 @@ from __future__ import annotations
4
4
 
5
5
  import json
6
6
  from pathlib import Path
7
+ from typing import Any
7
8
 
8
9
  from patchloop.scanner import ScanResult
9
10
 
10
11
 
11
12
  def write_scan_json(result: ScanResult, path: Path) -> None:
12
- payload = {
13
+ path.write_text(json.dumps(scan_payload(result), indent=2) + "\n", encoding="utf-8")
14
+
15
+
16
+ def scan_payload(result: ScanResult) -> dict[str, Any]:
17
+ return {
13
18
  "run_id": result.run_id,
14
19
  "project": result.project.root.name,
15
20
  "manager": result.project.manager,
@@ -23,4 +28,3 @@ def write_scan_json(result: ScanResult, path: Path) -> None:
23
28
  "expired_ignore_rules": [r.id for r in result.expired_rules],
24
29
  "warnings": result.warnings,
25
30
  }
26
- path.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
patchloop/report/sarif.py CHANGED
@@ -129,6 +129,11 @@ def build_sarif(
129
129
  }
130
130
 
131
131
 
132
+ def merge(payloads: list[dict[str, Any]]) -> dict[str, Any]:
133
+ """One SARIF file holding the runs of several projects."""
134
+ return {"$schema": SCHEMA, "version": "2.1.0", "runs": [r for p in payloads for r in p["runs"]]}
135
+
136
+
132
137
  def remaining(findings: list[Finding], results: list[FixResult]) -> list[Finding]:
133
138
  """After a fix run: the findings still open (not fixed, not skipped)."""
134
139
  open_keys = {
patchloop/schedule.py ADDED
@@ -0,0 +1,129 @@
1
+ """``patchloop schedule``: write a GitHub Actions workflow that runs PatchLoop on a timer.
2
+
3
+ GitHub runs it on its own servers, so the schedule keeps working whether or not anyone's
4
+ computer is on. The command only writes the file; committing it is up to the user.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import re
10
+ from dataclasses import dataclass
11
+ from pathlib import Path
12
+
13
+ from patchloop import proc
14
+
15
+ ACTION = "AyushSingh012/PatchLoop@v0"
16
+ DAYS = ("sun", "mon", "tue", "wed", "thu", "fri", "sat")
17
+ EVERY = ("day", "week", "month")
18
+
19
+
20
+ class ScheduleError(Exception):
21
+ """The schedule or the place to write the workflow is not usable."""
22
+
23
+
24
+ def cron_for(every: str, day: str, at: str) -> str:
25
+ """A cron line (UTC) for ``every`` day / week (on ``day``) / month (on the 1st) ``at``."""
26
+ m = re.fullmatch(r"([01]?\d|2[0-3]):([0-5]\d)", at.strip())
27
+ if not m:
28
+ raise ScheduleError(f"--at must be HH:MM in 24-hour UTC time, not '{at}'")
29
+ hour, minute = int(m.group(1)), int(m.group(2))
30
+ if every == "day":
31
+ return f"{minute} {hour} * * *"
32
+ if every == "week":
33
+ key = day.strip().lower()[:3]
34
+ if key not in DAYS:
35
+ raise ScheduleError(f"--day must be a weekday (mon … sun), not '{day}'")
36
+ return f"{minute} {hour} * * {DAYS.index(key)}"
37
+ if every == "month":
38
+ return f"{minute} {hour} 1 * *"
39
+ raise ScheduleError(f"--every must be day, week or month, not '{every}'")
40
+
41
+
42
+ def check_cron(cron: str) -> str:
43
+ """A five-field cron line, as GitHub accepts it."""
44
+ fields = cron.split()
45
+ if len(fields) != 5 or not all(re.fullmatch(r"[\d*/,\-]+", f) for f in fields):
46
+ raise ScheduleError(f"--cron must have 5 fields like '0 6 * * 1', not '{cron}'")
47
+ return " ".join(fields)
48
+
49
+
50
+ def describe(cron: str) -> str:
51
+ minute, hour, dom, _, dow = cron.split()
52
+ if not (minute.isdigit() and hour.isdigit()):
53
+ return f"on the cron schedule '{cron}' (UTC)"
54
+ at = f"{int(hour):02d}:{int(minute):02d} UTC"
55
+ if dom == "*" and dow == "*":
56
+ return f"every day at {at}"
57
+ if dom == "*" and dow.isdigit() and int(dow) < 7:
58
+ names = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
59
+ return f"every {names[int(dow)]} at {at}"
60
+ if dom == "1" and dow == "*":
61
+ return f"on the 1st of every month at {at}"
62
+ return f"on the cron schedule '{cron}' (UTC)"
63
+
64
+
65
+ @dataclass(frozen=True)
66
+ class Target:
67
+ repo_root: Path
68
+ project_rel: str
69
+ """The project folder relative to the repo root ('' for the root)."""
70
+
71
+ @property
72
+ def workflow(self) -> Path:
73
+ slug = re.sub(r"[^A-Za-z0-9]+", "-", self.project_rel).strip("-").lower()
74
+ name = f"patchloop-{slug}.yml" if slug else "patchloop.yml"
75
+ return self.repo_root / ".github" / "workflows" / name
76
+
77
+
78
+ def find_target(project: Path) -> Target:
79
+ top = proc.run(["git", "rev-parse", "--show-toplevel"], cwd=project, timeout=10)
80
+ if not top.ok:
81
+ raise ScheduleError(f"{project} is not inside a git repository")
82
+ root = Path(top.stdout.strip()).resolve()
83
+ rel = project.resolve().relative_to(root)
84
+ return Target(root, "" if rel == Path() else rel.as_posix())
85
+
86
+
87
+ def _quote(value: str) -> str:
88
+ return '"' + value.replace("\\", "\\\\").replace('"', '\\"') + '"'
89
+
90
+
91
+ def workflow_text(cron: str, project_rel: str = "", min_severity: str | None = None) -> str:
92
+ name = f"PatchLoop ({project_rel})" if project_rel else "PatchLoop"
93
+ inputs = []
94
+ if project_rel:
95
+ inputs.append(f" path: {_quote(project_rel)}")
96
+ if min_severity:
97
+ inputs.append(f" min-severity: {min_severity.upper()}")
98
+ with_block = ("\n with:\n" + "\n".join(inputs)) if inputs else ""
99
+ return f"""# Written by `patchloop schedule`. Runs PatchLoop {describe(cron)}
100
+ # on GitHub's servers; it opens one PR with the fixes, or updates the open one.
101
+ name: {_quote(name)}
102
+
103
+ on:
104
+ schedule:
105
+ - cron: "{cron}"
106
+ workflow_dispatch: # a "Run workflow" button on the Actions tab
107
+
108
+ permissions:
109
+ contents: write
110
+ pull-requests: write
111
+
112
+ jobs:
113
+ fix:
114
+ runs-on: ubuntu-latest
115
+ steps:
116
+ - uses: actions/checkout@v7
117
+ with:
118
+ fetch-depth: 0
119
+ - uses: {ACTION}{with_block}
120
+ """
121
+
122
+
123
+ def write_workflow(target: Target, text: str, force: bool = False) -> Path:
124
+ path = target.workflow
125
+ if path.exists() and not force:
126
+ raise ScheduleError(f"{path} already exists; use --force to replace it")
127
+ path.parent.mkdir(parents=True, exist_ok=True)
128
+ path.write_text(text, encoding="utf-8")
129
+ return path
patchloop/targets.py ADDED
@@ -0,0 +1,82 @@
1
+ """Which project folders a command runs on: the folders given, ``--all`` projects below
2
+ them, minus ``--skip``.
3
+
4
+ ``scan`` on a folder that is not itself a project covers every project inside it (scanning
5
+ changes nothing). ``fix`` does that only with ``--all``, because it can open many PRs.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from dataclasses import dataclass
11
+ from pathlib import Path
12
+
13
+ from patchloop.workspaces import find_projects, is_project
14
+
15
+
16
+ class TargetError(Exception):
17
+ """The folders and flags given select no project to run on."""
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class Target:
22
+ path: Path
23
+ label: str
24
+ """How the project is shown: its path relative to the current folder."""
25
+
26
+
27
+ def label_for(path: Path, cwd: Path | None = None) -> str:
28
+ cwd = (cwd or Path.cwd()).resolve()
29
+ path = path.resolve()
30
+ if path == cwd:
31
+ return path.name or str(path)
32
+ try:
33
+ return path.relative_to(cwd).as_posix()
34
+ except ValueError:
35
+ return str(path)
36
+
37
+
38
+ def _skipped(label: str, skip: list[str]) -> bool:
39
+ """``--skip a/b`` leaves out that folder and everything below it; ``--skip name`` (no
40
+ slash) also matches a project folder of that name anywhere."""
41
+ for s in skip:
42
+ s = s.strip().strip("/").removeprefix("./")
43
+ if not s:
44
+ continue
45
+ if label == s or label.startswith(f"{s}/"):
46
+ return True
47
+ if "/" not in s and label.rsplit("/", 1)[-1] == s:
48
+ return True
49
+ return False
50
+
51
+
52
+ def select(
53
+ paths: list[Path],
54
+ *,
55
+ all_projects: bool,
56
+ expand: bool,
57
+ skip: list[str] | None = None,
58
+ cwd: Path | None = None,
59
+ ) -> list[Target]:
60
+ """The projects to run on, in order, without duplicates.
61
+
62
+ ``expand``: a folder that is not a project stands for the projects inside it (``scan``).
63
+ Otherwise it is kept as is, and detection explains what is there (``fix`` without --all).
64
+ """
65
+ found: list[Path] = []
66
+ for p in paths or [Path()]:
67
+ p = p.resolve()
68
+ inside = [p / rel for rel in find_projects(p)] if (all_projects or expand) else []
69
+ if all_projects:
70
+ found += ([p] if is_project(p) else []) + inside
71
+ if not is_project(p) and not inside:
72
+ found.append(p) # nothing here: let detection say why
73
+ elif is_project(p) or not inside:
74
+ found.append(p)
75
+ else:
76
+ found += inside
77
+ unique = list(dict.fromkeys(found))
78
+ targets = [Target(p, label_for(p, cwd)) for p in unique]
79
+ kept = [t for t in targets if not _skipped(t.label, skip or [])]
80
+ if targets and not kept:
81
+ raise TargetError("--skip left no project to run on")
82
+ return kept
patchloop/workspaces.py CHANGED
@@ -88,8 +88,10 @@ def is_project(d: Path) -> bool:
88
88
  return (d / "package.json").is_file() and any((d / f).is_file() for f in JS_LOCKFILES)
89
89
 
90
90
 
91
- def find_projects(root: Path, max_depth: int = 3) -> list[str]:
92
- """Folders under ``root`` (relative) that hold a project with its lockfile."""
91
+ def find_projects(root: Path, max_depth: int = 4) -> list[str]:
92
+ """Folders under ``root`` (relative, not ``root`` itself) that hold a project with its
93
+ lockfile. Projects inside projects count too (a repo with one at its root and more in
94
+ client/ and server/); workspace members have no lockfile of their own, so they don't."""
93
95
  out: list[str] = []
94
96
 
95
97
  def walk(d: Path, depth: int) -> None:
@@ -100,11 +102,10 @@ def find_projects(root: Path, max_depth: int = 3) -> list[str]:
100
102
  except OSError:
101
103
  return
102
104
  for c in children:
103
- if c.name in SKIP_DIRS or c.name.startswith("."):
105
+ if c.name in SKIP_DIRS or c.name.startswith(".") or c.is_symlink():
104
106
  continue
105
107
  if is_project(c):
106
108
  out.append(c.relative_to(root).as_posix())
107
- continue # a workspace's members are part of it
108
109
  walk(c, depth + 1)
109
110
 
110
111
  walk(root, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchloop
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: Fix vulnerable dependencies in Python and JavaScript projects: upgrade, test, rescan, one PR.
5
5
  Keywords: security,vulnerabilities,cve,dependencies,uv,poetry,npm,pnpm,yarn
6
6
  Author: Ayush Kumar Singh
@@ -26,12 +26,17 @@ Requires-Dist: rich>=13.7
26
26
  Requires-Dist: tomlkit>=0.13
27
27
  Requires-Dist: typer>=0.12
28
28
  Requires-Python: >=3.12
29
+ Project-URL: Documentation, https://ayushsingh012.github.io/PatchLoop/
29
30
  Project-URL: Repository, https://github.com/AyushSingh012/PatchLoop
30
31
  Project-URL: Issues, https://github.com/AyushSingh012/PatchLoop/issues
31
32
  Description-Content-Type: text/markdown
32
33
 
33
34
  # PatchLoop
34
35
 
36
+ 📖 **[Documentation](https://ayushsingh012.github.io/PatchLoop/)** ·
37
+ **[Which command do I run?](https://ayushsingh012.github.io/PatchLoop/commands/)** ·
38
+ [PyPI](https://pypi.org/project/patchloop/)
39
+
35
40
  Finds vulnerable dependencies in a Python project (uv or Poetry) or a JavaScript project
36
41
  (npm, pnpm or yarn: Next.js, React, Node), upgrades them to the
37
42
  lowest safe version, runs your tests, rescans to confirm each fix, and opens **one** GitHub
@@ -49,6 +54,10 @@ pipx install patchloop # or: uv tool install patchloop
49
54
  patchloop --version
50
55
  ```
51
56
 
57
+ Upgrade with the same tool you installed with: `pipx upgrade patchloop`,
58
+ `uv tool upgrade patchloop`, or `pip install --upgrade patchloop` (there is no
59
+ `pip upgrade`).
60
+
52
61
  To get the latest unreleased code instead:
53
62
  `uv tool install "git+https://github.com/AyushSingh012/PatchLoop"`.
54
63
 
@@ -294,17 +303,24 @@ and refreshed only when it changes.
294
303
  widened in each member that has it; the PR names the file (`packages/web/package.json`).
295
304
  - Tests: the root's `test` script when there is one; otherwise each member's own `test`
296
305
  script, run in that member's folder. uv runs `uv sync --frozen --all-packages` and
297
- `uv run --all-packages pytest -q`. Set `validation.test` to use your own command.
306
+ `uv run --all-packages pytest -q`. Set `validate.test` to use your own command.
298
307
  - npm does not apply new `overrides` to packages under workspace members once they are
299
308
  locked, so a vulnerable package capped by its parent in an npm workspace is reported as
300
309
  blocked instead of forced. pnpm and yarn force it as usual.
301
310
  - Running it on a member folder says which workspace root to use instead.
302
311
 
303
- **Repos with separate projects** (say `backend/` with uv.lock and `web/` with
304
- package-lock.json) are fixed one folder at a time: `patchloop fix backend`, then
305
- `patchloop fix web`. Each folder gets its own branch (`patchloop/security-fixes-backend`)
306
- and its own PR, titled with the folder. Run at the repo root, PatchLoop lists the folders it
307
- found.
312
+ **Several projects at once** (a folder of repos, or a repo with `backend/` and `web/`):
313
+
314
+ ```sh
315
+ patchloop scan # in a folder that isn't a project: scans every one
316
+ patchloop scan backend web # just these folders
317
+ patchloop fix --all --no-push # fix every project, local branches only
318
+ patchloop fix --all --skip legacy # all but some; one branch and PR per project
319
+ ```
320
+
321
+ A summary table lists each project's findings (or fixes and PR link). If one project
322
+ fails, the rest still run; the exit code is 2 if any failed, else 1 if findings remain.
323
+ Details: [Many projects at once](https://ayushsingh012.github.io/PatchLoop/guides/many-projects/).
308
324
 
309
325
  ## Poetry projects
310
326
 
@@ -317,6 +333,66 @@ Poetry 1.x and 2.x both work.
317
333
  Poetry rejects any version that declares `python <4` when the project's range is open-ended
318
334
  (`>=3.12`), so bound it (`>=3.12,<4` or `^3.12`), as most Poetry projects already do.
319
335
 
336
+ ## Run it on a schedule (GitHub Action)
337
+
338
+ GitHub can run PatchLoop on a schedule on its own servers (your computer can be off). Each
339
+ run opens one PR, or updates the open one. The quickest way to set it up:
340
+
341
+ ```sh
342
+ patchloop schedule # every Monday at 06:00 UTC
343
+ patchloop schedule --every day --at 22:00 # or --every week --day fri, --every month
344
+ patchloop schedule apps/web --cron "0 6 * * 1-5" # a project in a subfolder, any cron line
345
+ ```
346
+
347
+ It writes `.github/workflows/patchloop.yml` (or `patchloop-<folder>.yml`) and prints the
348
+ next steps: commit and push the file, and allow Actions to open PRs (below). The file it
349
+ writes looks like this, if you'd rather write it yourself:
350
+
351
+ ```yaml
352
+ name: PatchLoop
353
+ on:
354
+ schedule:
355
+ - cron: "0 6 * * 1" # every Monday 06:00 UTC; pick any schedule
356
+ workflow_dispatch: # adds a "Run workflow" button
357
+
358
+ permissions:
359
+ contents: write
360
+ pull-requests: write
361
+
362
+ jobs:
363
+ fix:
364
+ runs-on: ubuntu-latest
365
+ steps:
366
+ - uses: actions/checkout@v7
367
+ with:
368
+ fetch-depth: 0
369
+ - uses: AyushSingh012/PatchLoop@v0
370
+ ```
371
+
372
+ One-time repo setting: **Settings → Actions → General → Workflow permissions → "Allow
373
+ GitHub Actions to create and approve pull requests"**. Without it GitHub refuses the PR.
374
+
375
+ Inputs (all optional):
376
+
377
+ | Input | Default | What it does |
378
+ |---|---|---|
379
+ | `command` | `fix` | `fix` opens or updates the PR; `scan` only reports |
380
+ | `path` | `.` | the project folder (for a repo with several projects, one job each) |
381
+ | `min-severity` | from patchloop.yml, else `HIGH` | `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` |
382
+ | `args` | | extra arguments, e.g. `--sarif patchloop.sarif` |
383
+ | `version` | newest | PatchLoop version from PyPI |
384
+ | `token` | `GITHUB_TOKEN` | see below |
385
+ | `fail-on-findings` | `false` | fail the job when vulnerabilities remain |
386
+
387
+ The job installs PatchLoop, osv-scanner, and Poetry or pnpm/yarn when the project needs
388
+ them; uv, Node and git are already on GitHub's runners. Your tests run as usual
389
+ (`validation.test` in patchloop.yml sets the command).
390
+
391
+ PRs opened with the default `GITHUB_TOKEN` don't start your other workflows (GitHub's
392
+ rule), so CI won't run on the PR by itself. To get CI on it, pass a personal access token
393
+ or a GitHub App token with `contents` and `pull-requests` write access:
394
+ `token: ${{ secrets.PATCHLOOP_TOKEN }}`.
395
+
320
396
  ## Output files
321
397
 
322
398
  `scan` and `fix` take `--json FILE` and `--sarif FILE`. The SARIF file (2.1.0) points each
@@ -351,8 +427,8 @@ the CLI writes to `--json`. Nothing is printed.
351
427
  when that fails). Public packages served through a private mirror work; packages that
352
428
  exist only in a private registry have no public advisories, so they are not checked.
353
429
  - Poetry has no workspaces, so a Poetry monorepo is fixed one project folder at a time.
354
- - GitHub only. There is no built-in schedule: run it from a scheduled CI job or cron
355
- (re-runs update the one open PR instead of opening another).
430
+ - GitHub only. Scheduling comes from GitHub Actions (above) or cron; re-runs update the
431
+ one open PR instead of opening another.
356
432
 
357
433
  ## Releasing
358
434
 
@@ -2,9 +2,9 @@ patchloop/__init__.py,sha256=skVZghYJ0bFTzRwyCjjy1CLzQmFc5OPbSZtc4dACiJQ,806
2
2
  patchloop/api.py,sha256=6uN9gTJccm8Q3MfKWmhHmDqH16qcVfQ4ZOK_NVfC79Q,3704
3
3
  patchloop/build.py,sha256=1BGabcRIEN_wCvxNWGrbjxJItyqFCIK1r6Mtkx3sTrs,4288
4
4
  patchloop/classify.py,sha256=s2Py6nPjp1NIeE6CZVEHCav5TT44TmNZS5BWuPW3mcI,5452
5
- patchloop/cli.py,sha256=vFIwH2ZaAVTvoN8FOiEzkr4-Fvvl2G9JKPS7a3yfUjs,12420
5
+ patchloop/cli.py,sha256=MUcyYTY9clA8F_4td7-wRiOs4Ub80m9qwnleewbRrpw,23816
6
6
  patchloop/config.py,sha256=BbmqcuqeaeTd6TmOpwry-L9JBfj7XLvifLpSYOQ9OMI,5762
7
- patchloop/detect.py,sha256=rmzG_8Yo9xNPU9DEQK9UXHusTfKqNkadVXNwu5EhIuw,4531
7
+ patchloop/detect.py,sha256=YAeyY4tCfuIE0t6FjSwm5WS7oHXAliTICXkmtCOIApE,4539
8
8
  patchloop/doctor.py,sha256=ZfB5GlNlakj_9Qxnri2_PAW_1aEQsterJ881QGziYUE,7028
9
9
  patchloop/enrich/__init__.py,sha256=0JmQD5MkqdEIToIflYSDAv4FFH-GSoToEQ5h7BCV1Sg,2015
10
10
  patchloop/enrich/epss.py,sha256=-recWudnVgP8yXAW9dtN071ShF-5_TFjhRcXok9rfUg,2176
@@ -15,8 +15,8 @@ patchloop/fixers/js_fix.py,sha256=b46RENe2ornUuJSc55QDDZqtdpZ6fZ2z2LbCZRjpApY,12
15
15
  patchloop/fixers/poetry_fix.py,sha256=biNzKQNq8JW6UKPI7-QTwGONXn01v9vumldpQ1G4des,6243
16
16
  patchloop/fixers/uv_fix.py,sha256=sAMqcH1wyqH52QtEF23M7YYx-FJubJNT1T8ihGs-zcU,4766
17
17
  patchloop/git_ops.py,sha256=WUaROKeEz_f1HvFv_TtIT_YB7utN9N04i_uTqPn9gaU,6833
18
- patchloop/github.py,sha256=iN3thq8AU5QN9ei3H6UueOR4MDmmCI6Pd9x1kLxjP8M,6373
19
- patchloop/hints.py,sha256=WYsYoiUPzIAJVPECW8QFn_J1GEQG33BJVNuDoZr9cGs,6418
18
+ patchloop/github.py,sha256=wxi6qTSem6EuoCbCQ9xGYXPuBj-leeDxXXs6mO7sE6c,6555
19
+ patchloop/hints.py,sha256=4SPDBZTwgPx510M-QeUnW_zCRxRcsMn42lEqebyF7CE,6517
20
20
  patchloop/images.py,sha256=BreHOE1-11W91zchle6hxoATDsR0f20lf_GJ4B5Nlpk,7828
21
21
  patchloop/isolate.py,sha256=DNSWHeW7D9zXVXUWpNxLElN4faSS9CPKLABuQykdMaQ,2029
22
22
  patchloop/js/__init__.py,sha256=NJgYCatQ2VJnOe8u73go_5PxiT7NOEctpe0Ibb9iMlE,47
@@ -34,23 +34,25 @@ patchloop/proc.py,sha256=2rj9wYpNAGMKBpoY9e2c7EZqVRTEnYrvUmlE1v6i6h8,2047
34
34
  patchloop/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  patchloop/pypi.py,sha256=CfygOhlnuEpE9UHw7nExSFZficqKsIGTBohzsJyDD4M,1956
36
36
  patchloop/report/__init__.py,sha256=S0JeaIt3vqGbyNcdA2xAlsRcQFeW1le-Ogmb74lhAJ0,75
37
- patchloop/report/console.py,sha256=6RHteZw_HB6rp_O9yg9K2T9aXcR0ZC2_2krGDWyU-Lc,9389
38
- patchloop/report/json_out.py,sha256=6z3tRnvFDKNt0TwYS5rpH3Ruf7NO8ctMIPxldJhAwkw,953
39
- patchloop/report/sarif.py,sha256=SyJTH_dugDKqjn8lRES-_hcLD4Q_SYDbBSNCJiMEZu8,5157
37
+ patchloop/report/console.py,sha256=JzO19cCL-REBXvCl050yf33yt7jfPcXGj1P3O1NdfSs,13526
38
+ patchloop/report/json_out.py,sha256=JlaXeiXEVhz0HQk6m-ERyZ32JdXdKLMsrKlxt6lM2UY,1044
39
+ patchloop/report/sarif.py,sha256=O0x0uojDind1CCmqMss0fd_8B8pXqkhAWh1qT2w1CHA,5384
40
40
  patchloop/runner.py,sha256=nS671LB_40eZh4ZG8U9ShVjdmCQwNVSQCVoiT1p7D7E,18509
41
41
  patchloop/scanner.py,sha256=lZiF59YV_Jl9Uo8DIkDNC-P-HDvtx4bgZTSJ-wrPS1U,7688
42
+ patchloop/schedule.py,sha256=kNR83roWsXdU52k3XSwmmMwUhy-xubi58-iF-sRaLF4,4571
42
43
  patchloop/sources/__init__.py,sha256=MXngt1WOxfGlCcBw2xijvaNjTI96v8V709kwqWUiqxA,70
43
44
  patchloop/sources/base.py,sha256=Dup3r3fsaF5mLyC5avQYNtN8Qg-6q3iGUCJpLzWWJVI,136
44
45
  patchloop/sources/imports.py,sha256=Y9NKyBz5dNRSJF8yenHkAw2x1M3ub1tjlqgFFFeGaGI,10720
45
46
  patchloop/sources/merge.py,sha256=Qt0--PnKxNebk1XE7uRLvacD3BAQUesKllWjfmPPdZ4,4018
46
47
  patchloop/sources/osv.py,sha256=NIqWECxJ_J4E5mMvJ_Rql_pNJiYgz8suhPzWIu-NjKE,10004
47
48
  patchloop/specifiers.py,sha256=1endLujc63Ban4i-BE96fQN8fa5rU1Z7FKoM3HTjt6k,10269
49
+ patchloop/targets.py,sha256=BKsgVxQeIqGc6Zb2-FZ_Cpg5PGq9ala_kWZk5orKx3s,2678
48
50
  patchloop/validate.py,sha256=jHgjKRgwNXFWSGeKHwUmtnm9q3AAcoLp69ryIAao7zI,7853
49
51
  patchloop/versions.py,sha256=w1RLRVX3qPWMe6KeBDWmikEZTRfDPKH23NcVxu_uZ2k,2567
50
- patchloop/workspaces.py,sha256=DDVR_Yxpx-DQqwkRjJKvFBADYo9AjGVdQNZ-zFVeyLg,5502
52
+ patchloop/workspaces.py,sha256=CwVgq79eLWXnQ4Q3uZsYiHIawTXYmobjT7eVrWyRKRI,5646
51
53
  patchloop/worktree.py,sha256=Nhrg6mXJJdAkCpItykbGHZ62l0x_1svVlWB15EzbGMY,5653
52
- patchloop-0.2.0.dist-info/licenses/LICENSE,sha256=b9nK3LhprXJT-KtmuZJIuDeFdNy7Hq0FR-R_f2oAer4,1074
53
- patchloop-0.2.0.dist-info/WHEEL,sha256=wfHFB5CQ4yOA68LQ_ISeFjKJGxj2GfVzMH9QxkYgrCw,81
54
- patchloop-0.2.0.dist-info/entry_points.txt,sha256=6Rzny6Msr-FRkBmtG1Wwi3vN2BCnhyovObirG5MAFhI,49
55
- patchloop-0.2.0.dist-info/METADATA,sha256=DUCIA7Px8lmRmbb1kXquDbn8cG7S6NvVo1FMSwTUAqI,18296
56
- patchloop-0.2.0.dist-info/RECORD,,
54
+ patchloop-0.4.0.dist-info/licenses/LICENSE,sha256=b9nK3LhprXJT-KtmuZJIuDeFdNy7Hq0FR-R_f2oAer4,1074
55
+ patchloop-0.4.0.dist-info/WHEEL,sha256=wfHFB5CQ4yOA68LQ_ISeFjKJGxj2GfVzMH9QxkYgrCw,81
56
+ patchloop-0.4.0.dist-info/entry_points.txt,sha256=6Rzny6Msr-FRkBmtG1Wwi3vN2BCnhyovObirG5MAFhI,49
57
+ patchloop-0.4.0.dist-info/METADATA,sha256=SxHAiyRHhqGvVNIdzAKgQK5tg85ews1CpzX9IqNG1po,21444
58
+ patchloop-0.4.0.dist-info/RECORD,,