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

Enable BlockNode#argument_list for numblocks. #155

Merged
merged 1 commit into from Nov 24, 2020

Conversation

dvandersluis
Copy link
Member

@dvandersluis dvandersluis commented Nov 23, 2020

Follows #154 (I'll rebase away that commit once merged).

numblocks now return an array of ArgNodes from BlockNode#argument_list, and BlockNode#arguments? is true for numblocks.

@dvandersluis
Copy link
Member Author

@marcandre you mentioned that maybe arguments? should be true for a numblock but now I think this is a bad idea. A whole bunch of cops assume arguments? mean that there are explicit arguments, and this will break expectations. I'm going to revert that part.

@dvandersluis dvandersluis force-pushed the numbered-blocks branch 4 times, most recently from 63e8b62 to d82d559 Compare November 23, 2020 21:56
@marcandre
Copy link
Contributor

Sounds good. I'm curious if all of these errors are genuine, or if some cops are just not numblock aware.

Maybe we should have a method accepts_arguments? (or arity? or something)?

@dvandersluis
Copy link
Member Author

dvandersluis commented Nov 24, 2020

I think maybe most cops are not numblock aware. There was one actual test failure, but then when I was looking at it, I noticed a lot of places use arguments? to determine how to autocorrect (which means that if numblock arguments count, we'll get some weird autocorrect, which is why I thought we should leave it as is).

Out of curiosity, what's the procedure for changing something that breaks rubocop's tests?

@marcandre
Copy link
Contributor

Out of curiosity, what's the procedure for changing something that breaks rubocop's tests?

Ideally we make the main gem work first, then we can bump the minimum main gem we fully support in the CI specs and builds are always good...

@dvandersluis dvandersluis force-pushed the numbered-blocks branch 2 times, most recently from 7cc7e60 to 5aab16b Compare November 24, 2020 14:32
@dvandersluis
Copy link
Member Author

@marcandre this is rebased now.

end
end
# rubocop:enable Naming/VariableNumber
Copy link
Contributor

Choose a reason for hiding this comment

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

I opened rubocop/rubocop#9091...

@marcandre marcandre merged commit dbfcf72 into rubocop:master Nov 24, 2020
@marcandre
Copy link
Contributor

Released as 1.2.0, thanks! 👍

@dvandersluis
Copy link
Member Author

Thanks @marcandre! ❤️

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.

None yet

2 participants