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

Make RuboCop::AST::IfNode support then? #341

Merged

Conversation

koic
Copy link
Member

@koic koic commented Dec 6, 2024

This PR makes RuboCop::AST::IfNode support then?, similar to RuboCop::AST::InPatternNode and RuboCop::AST::WhenNode.

@koic koic force-pushed the make_rubocop_ast_if_node_support_then_predicate branch 2 times, most recently from e6cf594 to 6c671d4 Compare December 6, 2024 06:46
#
# @return [Boolean] whether the node has an `then` clause
def then?
loc.begin&.is?('then')
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please rebase and use the new loc_is? here? 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! I've updated it!

This PR makes `RuboCop::AST::IfNode` support `then?`,
similar to `RuboCop::AST::InPatternNode` and `RuboCop::AST::WhenNode`.
@koic koic force-pushed the make_rubocop_ast_if_node_support_then_predicate branch from 6c671d4 to a2f86f9 Compare December 13, 2024 02:24
@marcandre marcandre merged commit 525f2ae into rubocop:master Dec 13, 2024
20 checks passed
@marcandre
Copy link
Contributor

Thank you!

@koic koic deleted the make_rubocop_ast_if_node_support_then_predicate branch December 13, 2024 14:54
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