rubocop / rubocop-ast

RuboCop's AST extensions and NodePattern functionality
https://docs.rubocop.org/rubocop-ast
MIT License
112 stars 53 forks source link

Deprecate `EnsureNode#body` in favour of `EnsureNode#branch` #337

Closed dvandersluis closed 2 weeks ago

dvandersluis commented 2 weeks ago

Given the upcoming method change in #336, but also the fact that the tests of that PR cannot pass as-is since rubocop is still relying on the old definition, I thought it would make sense to deprecate EnsureNode#body and add #branch as an alias. Once released, I can update the uses of EnsureNode#body in rubocop (and extensions) without breaking anything, which will allow the "Main Gem Specs" CI to pass.

dvandersluis commented 2 weeks ago

Thank you @Earlopain! Everything is green now. Marking this PR as ready for review.

marcandre commented 2 weeks ago

Great. Could you add a Changelog entry please 🙏

dvandersluis commented 2 weeks ago

Yes! Updated now.

marcandre commented 2 weeks ago

Thanks so much ❤️

Released as 1.36.0

Earlopain commented 2 weeks ago

One consideration, I don't believe this should show the deprecation warning rightaway. There is currently no RuboCop version that will not show this warning

Earlopain commented 2 weeks ago

https://github.com/rubocop/rubocop-ast/pull/339