Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parser for swift-show-dependencies.deplock #3829

Merged
merged 8 commits into from
Jun 28, 2024

Conversation

keshav-space
Copy link
Member

@keshav-space keshav-space commented Jun 26, 2024

Reference: aboutcode-org/scancode.io#1278

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
@keshav-space keshav-space marked this pull request as draft June 26, 2024 12:50
@keshav-space keshav-space force-pushed the add-swift-dependency-relationship branch from 7fa8490 to 293eaf0 Compare June 26, 2024 16:00
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
@keshav-space keshav-space force-pushed the add-swift-dependency-relationship branch from 293eaf0 to 52efbbf Compare June 26, 2024 16:01
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
@keshav-space keshav-space marked this pull request as ready for review June 26, 2024 18:53
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

@keshav-space LGTM! Thanks++
This works nicely for package resolution and dependency graph creation on the SCIO side. I have a couple nits for your consideration, this is ready to merge afterwards.
Also merge from latest to resolve conflicts.

src/packagedcode/swift.py Outdated Show resolved Hide resolved
src/packagedcode/swift.py Outdated Show resolved Hide resolved
src/packagedcode/swift.py Show resolved Hide resolved
tests/packagedcode/test_swift.py Show resolved Hide resolved
@AyanSinhaMahapatra
Copy link
Member

AyanSinhaMahapatra commented Jun 27, 2024

One more question, I assume we cannot parse Package.swift files like this one here: https://github.com/swift-cloud/VercelUI/blob/main/Package.swift right, becuase this is in swift and not parseable in python easily?

@keshav-space
Copy link
Member Author

One more question, I assume we cannot parse Package.swift files like this one here: https://github.com/swift-cloud/VercelUI/blob/main/Package.swift right, becuase this is in swift and not parseable in python easily?

@AyanSinhaMahapatra We are not directly parsing the Package.swift file, but we parse the Package.swift.deplock, which is a JSON dump of Package.swift. In the future, we may add support for natively parsing the Package.swift file, and we can use Tree-Sitter (an optional dependency) for creating and parsing the Swift AST.

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

Thanks @keshav-space! Merging!

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit 60b0e0f into develop Jun 28, 2024
34 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the add-swift-dependency-relationship branch June 28, 2024 16:52
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