Skip to content

Instantly share code, notes, and snippets.

@emwalker
Last active September 12, 2017 20:43
Show Gist options
  • Select an option

  • Save emwalker/d77c733d98853b5496328c6778e6de68 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

why did you exclude queries objects from this rule?

@emwalker

emwalker commented Sep 12, 2017

Copy link
Copy Markdown
Author

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
Copy Markdown

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

@topherhunt

Copy link
Copy Markdown

👍

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