Skip to content

Conversation

@pradhyum6144
Copy link

Problem
In Scala, case classes and inner classes defined within sealed traits or objects compile to separate .class files that may not follow the standard $-separated naming convention.
Solution
Implemented a fallback mechanism specifically for Scala that searches for source files in the same package directory when an exact match is not found.
Testing
All syntax checks passed
New test case covers the specific scenario described in issue #1875
Maintains backward compatibility with existing Java, Kotlin, and other JVM language mappings

…ode-org#1957)

- Modified resolve_pypi_packages() to accept multiple requirement files
- Updated get_data_from_manifests() to batch-process PyPI manifests together
- Maintained backward compatibility with existing single-file API
- Added comprehensive tests for multiple files and backward compatibility

This fix resolves issue aboutcode-org#1957 where the pipeline failed when multiple
manifest files (e.g., requirements.txt in different subfolders) were
present in a project. The solution leverages python-inspector's ability
to process multiple requirement files in a single call, which is more
efficient and provides better dependency resolution context.

Fixes aboutcode-org#1957

Signed-off-by: pradhyum6144 <pradhyum314@gmail.com>
Signed-off-by: pradhyum6144 <pradhyum314@gmail.com>
In Scala, case classes and inner classes defined within sealed traits
or objects compile to separate .class files that may not follow the
standard himBHsseparated naming convention. This fix implements a fallback
mechanism to handle these cases.

Changes:
- Added custom get_normalized_path() method to ScalaLanguage class
- Enhanced _map_jvm_to_class_resource() with Scala-specific fallback
  that searches for source files in the same package directory when
  exact match is not found
- Added comprehensive test case for Scala case class mapping

Fixes aboutcode-org#1875

Signed-off-by: pradhyum6144 <pradhyum314@gmail.com>
@pradhyum6144 pradhyum6144 force-pushed the fix-issue-1875-scala-case-classes branch from df27a3d to a522fab Compare November 30, 2025 21:50
@pradhyum6144
Copy link
Author

Hey @chinyeungli I've created a fix for this issue! I’d like you to review my code and accept it.

@chinyeungli chinyeungli requested a review from tdruez December 1, 2025 03:01
@chinyeungli
Copy link
Contributor

chinyeungli commented Dec 1, 2025

@tdruez perhaps you are in a better position for the review

Signed-off-by: pradhyum6144 <pradhyum314@gmail.com>
@pradhyum6144 pradhyum6144 force-pushed the fix-issue-1875-scala-case-classes branch from 4ec61ee to 955ac6c Compare December 1, 2025 23:43
@pradhyum6144 pradhyum6144 reopened this Dec 2, 2025
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