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

Fix alignment of the hash in one line #514

Merged
merged 1 commit into from
Oct 6, 2013

Conversation

saks
Copy link
Contributor

@saks saks commented Sep 27, 2013

This fixes incorrect behavior in the case, when hash is written in one line with different length of keys.

@jonas054
Copy link
Collaborator

Good catch @saks! I was just thinking that if any two keys are on the same line, that we should just return from on_hash and leave the hash as it is (with the exception of key alignment, where it makes sense to align even if there are multiple key-value pairs per line). @bbatsov @yujinakayama @saks What do you think?

@bbatsov
Copy link
Collaborator

bbatsov commented Sep 28, 2013

@jonas054 I think your suggestion is a good one.

@saks
Copy link
Contributor Author

saks commented Sep 28, 2013

Completely agree 👍

@bbatsov
Copy link
Collaborator

bbatsov commented Sep 29, 2013

@saks You should also mention the bugfix in the changelog.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 4, 2013

@saks Ping :-)

@saks
Copy link
Contributor Author

saks commented Oct 4, 2013

Sorry for the delay, was really hard week.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 5, 2013

@saks Looks good, but you'll need to rebase on top of the current master.

@saks
Copy link
Contributor Author

saks commented Oct 6, 2013

I did a rebase from current master. Is it ok now?

@yujinakayama
Copy link
Collaborator

I guess something is wrong. :)

I suggest the following steps to construct proper commit graph in the current state:

$ git checkout master
$ git branch -m fix_for_one_line_hash fix_for_one_line_hash.bak
$ git checkout -b fix_for_one_line_hash
$ git cherry-pick 4a8ee1b
error: could not apply 4a8ee1b... Fix alignment of the hashe containing different key lengths
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
# Fix the conflict...
# ...
$ git add .
$ git commit
$ git push -f your-remote-name fix_for_one_line_hash

Conflicts:
	spec/rubocop/cop/style/align_hash_spec.rb
@saks
Copy link
Contributor Author

saks commented Oct 6, 2013

You're right. Thanks. How about this? :)

bbatsov added a commit that referenced this pull request Oct 6, 2013
Fix alignment of the hash in one line
@bbatsov bbatsov merged commit 63c6e64 into rubocop:master Oct 6, 2013
@bbatsov
Copy link
Collaborator

bbatsov commented Oct 6, 2013

Yep, it's OK now.

@saks
Copy link
Contributor Author

saks commented Oct 6, 2013

Thanks

@jonas054 jonas054 mentioned this pull request Oct 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants