slack-ruby / slack-ruby-bot

The easiest way to write a Slack bot in Ruby.
MIT License
1.12k stars 187 forks source link

Add TargetRubyVersion for rubocop #245

Closed wasabigeek closed 4 years ago

wasabigeek commented 4 years ago

~Ran bundle exec rubocop --auto-correct~

~I could try to update the CI to use the repo's rubocop files in addition to the shared repo, though I'm not as familiar with Travis.~

Add the TargetRubyVersion so I don't embarrass myself in the future.

dangerpr-bot commented 4 years ago
1 Warning
:warning: Unless you’re refactoring existing code, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#245](https://github.com/slack-ruby/slack-ruby-bot/pull/245): Add targetrubyversion for rubocop - [@wasabigeek](https://github.com/wasabigeek).

Generated by :no_entry_sign: danger

dblock commented 4 years ago

We only test >= 2.3, is this still correct?

rubocop -a ; rubocop --auto-gen-config is my workflow

wasabigeek commented 4 years ago

Will try that command later, previously I also tried setting the version as 2.3 but it raised a lot of linting errors. The travis logs suggested that 2.2 was still being used for Rubocop

dblock commented 4 years ago

I guess my naive question is why would I merge this?

wasabigeek commented 4 years ago

Sure - it's slightly selfish, but my linter automatically marked a lot of issues, I guess because the default target ruby isn't 2.2. As a contributor, it wasn't clear if I should fix them or leave them.

EDIT: Not saying that 2.2 is the right version we should settle on, if we only support 2.3 and above then this PR could be changed accordingly (but I'm not sure how that will interplay with the danger repo)

dblock commented 4 years ago

Let's have a target version, I'll merge it.