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

Autofix Rubocop Layout rules - Batch 4 #321

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

nschonni
Copy link
Contributor

Forth run a the autofixing the Layout related Rubocop rules.
Most of these have options allowing overriding specific things if they style isn't preffered.

This is the last of the Layout, except for the 2 that were removed from the last batch

lib/ox/document.rb Outdated Show resolved Hide resolved
@ohler55
Copy link
Owner

ohler55 commented Feb 27, 2023

I noticed that arrays are expected to have no spaces next to the brackets yet hash maps expect spaces. That seems inconsistent to me. Can we be consistent in that regard? It doesn't matter to me which one is selected but consistent would be better.

@nschonni
Copy link
Contributor Author

I added the Rubocop dev dependency and gave this a rebase after the 2.7 bump included the sax_reactor back in.

If there are particular styles you don't like, if you comment on the line, I can try and look up the rule the changed it and if there is an EnforcedStyle

@@ -21,7 +21,7 @@ def to_s
end
end

obj = Classy.new(23, ['abc', {x: true}])
obj = Classy.new(23, ['abc', { x: true }])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect example of a mix of spaces after brackets and no space. I prefer consistent behaviour between [] and {}. Happy to go with either but not a mix.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe tight, no spaces after [ or { or before ] or } is best if there is no overriding consensus.

@nschonni nschonni changed the title Autofix Rubocop Layout rules - Batch Autofix Rubocop Layout rules - Batch 4 Mar 2, 2023
@nschonni nschonni force-pushed the rubocop-batch-4 branch 3 times, most recently from 540bef5 to 8135253 Compare March 3, 2023 18:53
@nschonni nschonni marked this pull request as draft March 3, 2023 18:55
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 this pull request may close these issues.

2 participants