FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Handle traits argument in Swift package dependencies by tjugdev · Pull Request #1746 · fossas/fossa-cli · GitHub

Handle traits argument in Swift package dependencies - #1746

Merged
tjugdev merged 2 commits into
masterfrom
ane-3093-swift-package-traits
Aug 20, 2026
Merged

Handle traits argument in Swift package dependencies#1746
tjugdev merged 2 commits into
masterfrom
ane-3093-swift-package-traits

Conversation

tjugdev commented Aug 17, 2026
edited by atlassian Bot
Loading

Copy link
Copy Markdown
Contributor

Overview

More recent versions of Swift let you pass a traits parameter to a .package() dependency. Our parser fail on this. Read, and then ignore the value of this field if it's set.

Acceptance criteria

The Package.swift from the ticket can be analyzed successfully.

Testing plan

  • Put the Package.swift from the ticket in a directory.
  • Run cabal run fossa -- analyze --output $YOUR_DIR and confirm we find the dependency correctly.

Risks

Highlight any areas that you're unsure of, want feedback on, or want reviewers to pay particular attention to.

Example: I'm not sure I did X correctly, can reviewers please double-check that for me?

Metrics

Is this change something that can or should be tracked? If so, can we do it today? And how? If its easy, do it

References

  • ANE-3093: Package.swift parser fails on Swift 6.1 package traits (.package(url:from:traits:))

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an ## Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

tjugdev requested a review from a team as a code owner August 17, 2026 20:00
tjugdev requested a review from GauravB159 August 17, 2026 20:00

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info ⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d74ab7e5-7f59-41c7-a131-47a4f16e5e21

📥 Commits

Reviewing files that changed from the base of the PR and between 1928041 and a93da53.

📒 Files selected for processing (4)
  • src/Strategy/Swift/PackageSwift.hs
  • test/Swift/PackageSwiftSpec.hs
  • test/Swift/testdata/Package.full.swift
  • test/Swift/testdata/Package.swift

Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review.


Walkthrough

The Swift package parser now provides a reusable top-level parser for quoted string arrays. Version argument parsing uses this shared parser. Git dependencies can optionally include a traits string array before the closing declaration. Swift package fixtures and expected parsed output now include a Git dependency with version 3.2.2 and the SomeTrait trait.

Merge Risk: ⚪ Minimal · up to a93da

This localized change adds support for ignoring Swift package dependency traits while preserving dependency discovery. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding support for the traits argument in Swift package dependencies.
Description check ✅ Passed The description explains the change, acceptance criteria, testing approach, and reference; placeholder Risks and Metrics sections remain incomplete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

GauravB159 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, probably just need to add a changelog entrry

tjugdev force-pushed the ane-3093-swift-package-traits branch from a93da53 to 2584857 Compare August 20, 2026 20:46
tjugdev enabled auto-merge (squash) August 20, 2026 20:47
tjugdev merged commit 3b42606 into master Aug 20, 2026
19 checks passed
tjugdev deleted the ane-3093-swift-package-traits branch August 20, 2026 21:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL