houndci / hound

Automated code review for GitHub pull requests.
https://houndci.com
MIT License
1.95k stars 401 forks source link

Style/BlockDelimiters: Avoid using {...} for multi-line blocks. not being ignored for rspec #1868

Closed bark-mshort closed 1 year ago

bark-mshort commented 1 year ago

We've been using hound for a while now and have been struggling with hound rules not matching our rubocop rules. According to rubocop, this matcher is allowed when changing to do-end would change the behavior of the block, and has been accepted since version 0.11.0.

On our pull requests, hound is detecting this as a violation, when it shouldn't be

image

Here is our current configuration:

coffeescript:
  enabled: false
  config_file: .coffeelint.json
eslint:
  enabled: true
  config_file: .eslintrc.json
  ignore_file: .eslintignore
  version: 7.7.0
haml:
  enabled: true
  config_file: .haml.yml
javascript:
  enabled: false
rubocop:
  version: 1.22.1
  config_file: .rubocop.yml
ruby:
  enabled: true
  config_file: .rubocop.yml
  version: 1.22.2
scss:
  enabled: false

The docs mention that we can specify a rubocop version, but they aren't clear if that's meant to replace the ruby config, which was added upon initial setup. I've tried different combinations of rubocop and ruby configs (including removing either block entirely) but the violation is still being detected.

Any suggestions on how to fix this, or is this a bug? According to your configuration documentation, 1.22. is a valid version that you support, but the rule itself has been around for a long time anyway and is supported by the default rubocop version.

bark-mshort commented 1 year ago

I stand corrected, it looks like it's a rule that's yet to be addressed: https://github.com/rubocop/ruby-style-guide/issues/522

Closing the issue