assaf / vanity

Experiment Driven Development for Ruby
http://vanity.labnotes.org
MIT License
1.55k stars 269 forks source link

Add rubocop #374

Closed frostmark closed 2 years ago

frostmark commented 2 years ago

Hey @bensheldon. I think would be nice to add rubocop and tidy up the code. What do you think?

bensheldon commented 2 years ago

I think Rubocop would be a big improvement to working in the code... but the downside is that it will make finding the meaningful history of a slice of code more difficult.

But I think we may as well do it. What are your thoughts on changing the required Ruby version to a non-EOLed Ruby? (2.6 EOLs in 1 month....2.7 ?). What kind of release should that get? (is a Minor release ok? It's sorta breaking change, but Bundler will guard against it; I sure hope people aren't still running Ruby 1.x)

https://github.com/assaf/vanity/blob/d61b2e1f8a003174c8c9183350374c9fd3f4de5b/vanity.gemspec#L24

frostmark commented 2 years ago

@bensheldon I think we can set to 2.7 as target version for rubocop. Which required minimal version do you think we should use? I would suggest set required_ruby_version = ">= 2.5" and stop supporting 1.9.3

bensheldon commented 2 years ago

Rubocop's target version needs to be set to the minimum required_ruby_version or else Rubocop may try to correct to a backward-incompatible feature (e.g. a Ruby 2.7-ism that doesn't work on 2.5).

I think required_ruby_version = ">= 2.5" sounds good.

frostmark commented 2 years ago

Okay, got it