Skip to content

Add CocoaPods scanner - #32

Merged
gr-markin merged 6 commits into
mainfrom
feature/cocoapods-scan
Sep 25, 2026
Merged

gr-markin merged 6 commits into
mainfrom
feature/cocoapods-scan

Conversation

@jthDEV

@jthDEV jthDEV commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a CocoaPodsScanner that parses the fully resolved dependency graph directly from Podfile.lock (PODS, DEPENDENCIES, SPEC CHECKSUMS sections) — no pod executable invocation needed since the lockfile is already resolved
  • Uses the cocoapods purl type as key/purl prefix; per-pod checksums from SPEC CHECKSUMS are attached to each Dependency
  • Registers CocoaPodsScanner alongside the other package-manager scanners; --cocoapods:ignore becomes available like for the other PM scanners

Dependencies added

  • PyYAML~=6.0 — to parse the YAML-formatted Podfile.lock (was already present as a transitive dependency of spdx-tools, now declared explicitly since ts-scan relies on it directly)

Test plan

  • pytest tests/test_cocoapods.py — accepts()/scan() unit tests against a representative Podfile.lock fixture, including a subspec dependency (SDWebImage/Core) and checksum propagation
  • pytest tests/ — full existing suite still passes

@jthDEV
jthDEV requested a review from gr-markin August 25, 2026 23:05
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
Comment thread tests/test_cocoapods.py Fixed
jthDEV and others added 2 commits September 22, 2026 14:43
Parses the resolved dependency graph directly from Podfile.lock (PODS,
DEPENDENCIES and SPEC CHECKSUMS sections). No pod executable is
required since the lockfile is already fully resolved.

Adds PyYAML as an explicit dependency for parsing the lockfile.
The branch predates "Return an iterable from scanner implementations",
so scan() still returned an optional single scan. Running it through the
CLI failed with "'DependencyScan' object is not iterable", because
_execute_scans yields from the scanner result.

Returns a list of scans instead, and an empty list for an empty
lockfile. The unit tests called scan() directly and therefore did not
catch this, so they now assert on the returned sequence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jthDEV
jthDEV force-pushed the feature/cocoapods-scan branch from 9803eb7 to 201d7cd Compare September 22, 2026 12:45
@jthDEV

jthDEV commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (the branch had drifted 11 commits behind) and updated by force-push.

Conflicts resolved: scanner registry in src/ts_scan/__init__.py, the PM option list in README.md, and the [Unreleased] section in CHANGELOG.md.

The rebase surfaced a real defect. This branch predates Return an iterable from scanner implementations, so scan() still returned an optional single DependencyScan. Through the CLI the scan aborted with:

✘ An error occured while scanning CocoaPods dependencies...
✘ 'DependencyScan' object is not iterable

The unit tests called scan() directly and therefore never hit it. Commit 201d7cd returns a list of scans (and an empty list for an empty lockfile) and adapts the tests to assert on the returned sequence. Verified end to end with ts-scan scan against a sample Podfile.lock; the full suite is green (43 passed).

Merge order: #38 (Composer) and #31 (Swift) touch the same registry and README lines. Suggested order is #38 → #32 → #31, with the README ecosystem list updated for all three in #31.

🤖 Generated with Claude Code

Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
Comment thread tests/test_cocoapods.py
@jthDEV jthDEV mentioned this pull request Sep 22, 2026
2 tasks done
gr-markin
gr-markin previously approved these changes Sep 25, 2026
@gr-markin

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits September 25, 2026 11:58
# Conflicts:
#	CHANGELOG.md
#	README.md
#	src/ts_scan/__init__.py

Co-authored-by: gr-markin <2349286+gr-markin@users.noreply.github.com>
Co-authored-by: gr-markin <2349286+gr-markin@users.noreply.github.com>
Copilot AI and others added 2 commits September 25, 2026 12:00
Co-authored-by: gr-markin <2349286+gr-markin@users.noreply.github.com>
Co-authored-by: gr-markin <2349286+gr-markin@users.noreply.github.com>

Copilot AI commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Done in 986f0a9 (merged origin/main and resolved conflicts in src/ts_scan/__init__.py, README.md, and CHANGELOG.md). I also applied follow-up fixes in d780558, f2d66d2, and 5d5d486 for Swift scanner state handling uncovered during validation.

Comment thread tests/test_swift.py Dismissed
Comment thread tests/test_swift.py Dismissed
Comment thread tests/test_swift.py Dismissed
Comment thread tests/test_swift.py Dismissed
@gr-markin
gr-markin merged commit 9a2d6f3 into main Sep 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants