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

Remove trailing comments in parsed SBT module version #3477

Conversation

aartigao
Copy link
Contributor

At $work we recently noticed that Scala Steward was not updating dependencies that have trailing comments like

"software.amazon.awssdk"                 % "dynamodb"                     % V.aws, // Overrides `scanamo` version
"software.amazon.awssdk"                 % "sso"                          % V.aws, // Needed for local dev!
"software.amazon.awssdk"                 % "sts"                          % V.aws  // Needed for EKS IAM!

these we're workarounding them by placing the comments elsewhere:

// The following comments are not inlined to avoid breaking Scala Steward!
// - Module `dynamodb` overrides `scanamo` version
// - Module `sso` is needed for local development
// - Module `sts` is needed for EKS IAM
"software.amazon.awssdk" % "dynamodb" % V.aws,
"software.amazon.awssdk" % "sso"      % V.aws,
"software.amazon.awssdk" % "sts"      % V.aws

but I think this can be easily avoided by changing the regex like in this PR.

I don't have any idea if this impacts anything else in the code (tests are green at least locally), so let's discuss it because I think the current behavior is not the expected one 🙏🏽

@alejandrohdezma
Copy link
Member

Hey @aartigao, thanks for this! Do you think it could be worth adding also a test when using a comment such as /* my comment */?

@aartigao
Copy link
Contributor Author

Hey @aartigao, thanks for this! Do you think it could be worth adding also a test when using a comment such as /* my comment */?

Sure!

@alejandrohdezma alejandrohdezma merged commit 251f21e into scala-steward-org:main Nov 19, 2024
5 checks passed
@alejandrohdezma
Copy link
Member

Thank you!!

@mzuehlke mzuehlke added this to the 0.31.2 milestone Nov 21, 2024
@mzuehlke mzuehlke added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cat:rewrite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants