bekicot / solargraph-standardrb

Solargraph reporter for standard rb
https://github.com/bekicot/solargraph-standardrb
MIT License
26 stars 7 forks source link

Diagnostics reporter standardrb does not exist #6

Closed benortiz closed 2 years ago

benortiz commented 2 years ago

I'm having a difficult time figuring out why I'm getting the above error.

I've gem installed standard, solargraph-standardrb, and solargraph.

For context, I'm running Solargraph through Neovim using the built in LSP.

My .solargraph.yml looks like this:

include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
plugins:
- solargraph-standardrb
reporters:
- standardrb
- require_not_found
max_files: 5000

I tried changing standardrb to standard since that's the name of the gem and no luck. Do you have any ideas on how to track down what's going on? Thanks!

dblanken commented 2 years ago

When I attempt to debug through, it looks like it is complaining about requiring standard that it's "unable to find a version of standard to activate".

I uninstalled all versions of standard and then re-installed this plugin. From there, it was able to find standard with no issue. My guess is that I had multiple versions of standard installed past 0.4.1 which is the minimum in the gemspec, so it didn't know which to use?

Before I had the folowing versions installed:

  1. standard-0.6.1
  2. standard-0.7
  3. standard-0.11.0
  4. standard-1.3.0

After I have: standard (1.5.0)

I'm unsure how solargraph-reek doesn't have the same issue as I have three versions of reek installed. Could it have to do with Solargraph-reek defining reek as a dependency vs a runtime dependency?

RobertAudi commented 2 years ago

Could it have to do with Solargraph-reek defining reek as a dependency vs a runtime dependency?

@dblanken No, both are the same, add_dependency is an alias of add_runtime_dependency.

dblanken commented 2 years ago

Hmmm, I'm unsure why it couldn't load standard then like the other repo does with reek.

benortiz commented 2 years ago

Hmmm. I'm using asdf to manage ruby versions, what are y'all using? Maybe it's an issue there?

dblanken commented 2 years ago

@benortiz I am also using ASDF. Possibly. How about you, @RobertAudi?

RobertAudi commented 2 years ago

I am using chruby not asdf.

bekicot commented 2 years ago

Hi, I would suggest to use the new rubocop feature. https://github.com/testdouble/standard#usage-via-rubocop

require: standard
inherit_gem:
  standard: config/base.yml

This will give you better experience.

I'm about to archive this repo once i have time to write docs on how to migrate.

Solargraph should automatically pick up the configuration.

dblanken commented 2 years ago

@bekicot Wonderful! Thanks for sharing that. I haven't been to their page in a while so good to see this can be done!

benortiz commented 2 years ago

Amazing, thank you so much @bekicot !