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

use toLowerCase to compare all files and paths #505

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

DMarinhoCodacy
Copy link
Contributor

No description provided.

Copy link

codacy-production bot commented May 31, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+12.73% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bddce28) 745 563 75.57%
Head commit (f377b8c) 359 (-386) 317 (-246) 88.30% (+12.73%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#505) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

@DMarinhoCodacy DMarinhoCodacy requested a review from machadoit June 3, 2024 08:12
.sortBy(name => Math.abs(filename.length - name.length))
.headOption
}

def getFilenameFromPath(filename: String): String = {
Try(Paths.get(filename).getFileName.toString).getOrElse(filename)
Try(Paths.get(filename).getFileName.toString.toLowerCase).getOrElse(filename.toLowerCase)
Copy link
Member

Choose a reason for hiding this comment

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

Do you know if this Paths.get(filename) should rely on the lower case or if they return the file on either case?
Is there a possibility to add a test for this?

Anyway I am fine moving forward if this unblocks a customer, but adding a follow up PR with a test could be cool

machadoit
machadoit previously approved these changes Jun 3, 2024
@DMarinhoCodacy DMarinhoCodacy requested a review from machadoit June 3, 2024 14:40
@machadoit
Copy link
Member

I guess I would expect some assertion on the specific file, but I also didn't touch this repo much, and see some similar tests, so LGTM!

@DMarinhoCodacy DMarinhoCodacy merged commit 5cad31b into master Jun 3, 2024
18 checks passed
@DMarinhoCodacy DMarinhoCodacy deleted the path-fixing-ignore-case branch June 3, 2024 15:44
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