Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should substitutions for procedural blocks add whitespace? #2

Closed
brunchybit opened this issue Nov 7, 2018 · 3 comments · Fixed by #9
Closed

Should substitutions for procedural blocks add whitespace? #2

brunchybit opened this issue Nov 7, 2018 · 3 comments · Fixed by #9

Comments

@brunchybit
Copy link

Adding standard to a gem I'm building, I ran bundle exec standard --fix and my default Gemfile was changed from:
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

to:

git_source(:github) do |repo_name| "https://github.com/#{repo_name}" end

Would we expect standard to decipher or try to determine white space there?

@searls
Copy link
Contributor

searls commented Nov 7, 2018

IMO, one-liners should be excluded from this rule entirely, but I don't know a way to do that. The configuration in question is:

Style/BlockDelimiters:
  EnforcedStyle: semantic

@brunchybit
Copy link
Author

Interesting, good to know. I wonder if I can dig in and figure out how to exclude one liners.

@searls
Copy link
Contributor

searls commented Nov 11, 2018

Shipped a fix for this in 0.0.5. You can see this cop for reference: https://github.com/testdouble/standard/blob/master/lib/standard/cop/semantic_blocks.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants