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

Change how help is referenced to avoid initialization oddness & update case-app to 2.1.0-M29 #3152

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

coreyoconnor
Copy link
Contributor

This includes the update for case-app.

This supersedes pull #2964

Draft because I don't really understand why this only effected some options and not others and why only with this version of case app. That said...

scala-cli overrides val messages. This override references name which is a def in CaseApp equal to help.progName. Which is equal to messages.progName. Which is the val messages being defined. I'm not entirely sure on that last bit but I suspect Scala is not entirely sure as well. :)

Breaking these recursive dependencies appears to work. That's what this patch tries to do.

I suspect there is an issue in how CaseApp is constructed. Or perhaps def help should be overriden instead of val messages.

@Gedochao
Copy link
Contributor

Gedochao commented Sep 10, 2024

Did some fixes:

  • formatting was off, ran scalafmt
  • merged changes from main into this branch
  • seems like your changes have fixed some of our unit tests, which weren't catching duplicate CLI options; fixed those

What's still breaking:

  • it seems the completions don't work correctly, still need to investigate the failing test: scala.cli.integration.InstallAndUninstallCompletionsTests.installing and uninstalling completions

@Gedochao
Copy link
Contributor

Seems it was just whitespace that changed in the fish completions file generation, unsure what is causing this.
I adjusted the associated test.
I also cleaned up the commit structure, so that we won't have to squash when we merge this, the individual changes should be separated.

@tgodzik can you verify fish completions still work okay after this? an extra pair of eyes on the code won't hurt, either.

@Gedochao Gedochao changed the title change how help is referenced to avoid initialization oddness Change how help is referenced to avoid initialization oddness & update case-app to 2.1.0-M29 Sep 10, 2024
@Gedochao Gedochao marked this pull request as ready for review September 10, 2024 14:08
Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

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

@coreyoconnor I tweaked the PR to make the tests pass, hope you don't mind.
Thanks for helping with this!

@Gedochao Gedochao merged commit c9c659c into VirtusLab:main Sep 10, 2024
78 checks passed
@coreyoconnor
Copy link
Contributor Author

@coreyoconnor I tweaked the PR to make the tests pass, hope you don't mind. Thanks for helping with this!

Woohoo! Thanks! Obviously I was away and only getting back to this now. XD Happy to help!

@coreyoconnor coreyoconnor deleted the break-recursive-init-oddness branch September 15, 2024 17:14
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.

3 participants