VirtusLab / scala-cli

Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)
https://scala-cli.virtuslab.org
Apache License 2.0
542 stars 128 forks source link

Pin library version/disable version checks #1822

Open JD557 opened 1 year ago

JD557 commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm frustrated with the hint messages asking me to update some libraries.

I believe that there are multiple valid use cases for Scala scripts where its intentional to pin libraries to a certain version and a message to update could be misleading. For example:

Describe the solution you'd like

I would like some way to express that a library version should be pinned. Also, it would be nice to guarantee that the check was completely skipped (no "phoning home") when all versions are pinned.

Some potential solutions:

sjrd commented 1 year ago

IMO pinning should even be the default. Perhaps there should be an explicit command upgrade or something that suggests all the stuff. But the default should not be to phone home on every run.

tgodzik commented 1 year ago

IMO pinning should even be the default. Perhaps there should be an explicit command upgrade or something that suggests all the stuff. But the default should not be to phone home on every run.

On one hand yes if we want to be as careful as possible, but on the other hand this feature would become unnoticed by 90% of users, so I would rather avoid doing that.

I think at a very minimum we should allow to disable this globally with https://github.com/VirtusLab/scala-cli/issues/1825

I think maybe //> using lib pinned "org::name:version" should be done later on as a final solution.

As a current workaround you should be able to do:

scala-cli config actions false

but that will disable all actionable diagnostics (we do not have many yet)