codeclimate / codeclimate-rubocop

Code Climate Engine for Rubocop
MIT License
60 stars 44 forks source link

Add support for standardrb #351

Closed cquinones100 closed 1 year ago

cquinones100 commented 1 year ago

We use standard along with rubocop in our project. We use the inherit_gem config in .rubocop.yml to add on to standard's config. We also use the require config to require standard along with other gems we use (rubocop-performance, rubocop-rails, etc).

Can a channel be made that requires standard?

BrianHawley commented 1 year ago

It should be possible to just include the standard gem in all regular channels that have compatible rubocop versions, then let people's rubocop config decide whether or not to use it.

RubyBrewsday commented 1 year ago

So actually @cquinones100 we do have a dedicated standardrb plugin already, we just don't actually have documentation up for it so I 100% understand how you haven't been able to add that in. Right now we only support version 1.1.5 but are in the process of releasing a newer version 1.4.0 in the near future.

To enable standard for your codebase, simply add the following to the plugins section of your .codeclimate.yml file:

plugins: 
  standard:
    enabled: true
---the rest of your configuration---

I'm really curious how this will work out for you. Please give it a shot and let us know if that solves your issue, otherwise happy to look into that some more 😄

Also so sorry for not responding sooner, will try and keep an eye out more in the future.

cquinones100 commented 1 year ago

Hi @RubyBrewsday thanks for the response! We don't use standard directly, instead we use it via rubocop[https://github.com/testdouble/standard#usage-via-rubocop], so I don't think we need the standard plugin-- instead i think we need a rubocop plugin channel that includes standard as @BrianHawley mentioned.

Additional context: we use rubocop version 1.39.0

RubyBrewsday commented 1 year ago

Ah gotcha, thanks for the extra context @cquinones100, makes sense to me. Yeah I think we should be able to make that happen for you.

RubyBrewsday commented 1 year ago

@cquinones100 Hey there, I hope you had a good weekend. Just wanted to give a heads up that I've tested out a fix and we should be pushing that up later on today. I'll let you know when that is ready to go but you should be able to use standard if you set your rubocop channel to rubocop-1-39-0 in your .codeclimate.yml file.

RubyBrewsday commented 1 year ago

@cquinones100 Okie doke, those changes should have gone out yesterday afternoon. If you could try re-running analysis on your repo and let us know how that works out for you that would be awesome. In case you might not know how to manually refresh your repo, check out this support article and that should show you the easiest way too (besides pushing up new code 😄): https://docs.codeclimate.com/docs/branches-and-comparisons#section-what-triggers-a-branch-analysis

BrianHawley commented 1 year ago

@RubyBrewsday you should also make a PR for channel/beta.

BrianHawley commented 1 year ago

It turns out that the standard gems are not released at the same pace as the corresponding rubocop gems that they reference. This means that referencing the standard gems at all in this engine prevents us from updating the other rubocop gems when new versions come out. This is currently preventing us from updating rubocop to 1.51.0, for instance.

It might be a good idea to have a separate set of channels for rubocop with the standard gems included, so the regular rubocop channels can keep up to date.

Alternatively, it might be a good idea to have the standard engine be able to handle the case of people running standard through rubocop instead of through its own tools, so the regular rubocop engine doesn't have to reference the standard gems.

@cquinones100 @RubyBrewsday