Skip to content

Instantly share code, notes, and snippets.

@emwalker
Last active September 12, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emwalker/d77c733d98853b5496328c6778e6de68 to your computer and use it in GitHub Desktop.
Save emwalker/d77c733d98853b5496328c6778e6de68 to your computer and use it in GitHub Desktop.
Rubocop rules for block braces
# Space between `method_name` and `{`
# https://rubocop.readthedocs.io/en/latest/cops_layout/#layoutspacebeforeblockbraces
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
Exclude:
- 'app/queries/*'
# Space after block `{` and space before `}`
# https://rubocop.readthedocs.io/en/latest/cops_layout/#layoutspacebeforeblockbraces
Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
Exclude:
- 'app/queries/*'
@roman-dubrovsky
Copy link

why did you exclude queries objects from this rule?

@emwalker
Copy link
Author

emwalker commented Sep 12, 2017

Some of them use a DSL called squeel, which looks like this:

    where{(circle_id.eq my{id}) | (global.eq true)}

This is how squeel is normally used, and I don't want to go back and change a bunch of code to something that looks unusual for the DSL.

@AleksSenkou
Copy link

In order not to have conflicts with squeel it's better to exclude queries folder from those metrics.

@topherhunt
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment