-
Notifications
You must be signed in to change notification settings - Fork 337
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
Should I get an error when running run_scalafix
without having any rules defined?
#4070
Comments
Thanks for reporting this @caenrique! You're correct, this shouldn't happen. I'd expect the user to see a nicer message this this, not an |
Thanks for reporting! So the question here is whether we should just show a nicer error or maybe we should add OrganizeImports by default ? |
I came up with three options (1 is the easiest, 3 is the richest, I guess)
|
Yea I'm sort of liking Another easy alternative to |
If you decide to go for
That's definitely something that would be beneficial to all scalafix clients, and it wouldn't be too hard to implement by inferring a high-level tool-classpath from dependencies optionally listed in the conf file. I understand it would reduce the complexity of the |
Sure, to expand on the example I had, let's pretend that we create a |
Thanks @ckipp01, very clear - I added scalacenter/scalafix#1625 to track the feature request. |
Discussed in scalameta/nvim-metals#420
Originally posted by caenrique June 27, 2022
I have an autocommand on BufWritePre to run scalafix with the organize imports rule, but this is only set up in some of my projects. When it gets executed in a project without any rules defined I get this error in the nvim messages:
[nvim-metals] Could not execute command: Internal error.
metals log:
I'm not sure what the expectations for this API is. Should I handle this case myself, or is this behaviour unexpected.
I would expect that it just does nothing if there aren't any scalafix rules defined in the project
The text was updated successfully, but these errors were encountered: