Skip to content

Conversation

koic
Copy link
Member

@koic koic commented May 2, 2025

This PR supports RuboCop::AST::ComplexNode.

The complex type is categorized as a numeric type, so it should be handled transparently alongside int, float, and rational.

int: :numeric,
float: :numeric,
rational: :numeric,
complex: :numeric,

https://github.com/rubocop/rubocop-ast/blob/v1.44.1/lib/rubocop/ast/node.rb#L106-L109

This eliminates the need for redundant branching, such as in rubocop/rubocop#14146.

This PR supports `RuboCop::AST::ComplexNode`.

The `complex` type is categorized as a `numeric` type,
so it should be handled transparently alongside `int`, `float`, and `rational`.

```ruby
int: :numeric,
float: :numeric,
rational: :numeric,
complex: :numeric,
```

https://github.com/rubocop/rubocop-ast/blob/v1.44.1/lib/rubocop/ast/node.rb#L106-L109

This eliminates the need for redundant branching, such as in rubocop/rubocop#14146.
@koic koic force-pushed the support_rubocop_ast_complex_node branch from 90c3098 to de62cd7 Compare July 16, 2025 10:16
@marcandre marcandre merged commit 745ae82 into rubocop:master Jul 16, 2025
22 checks passed
@marcandre
Copy link
Contributor

Oh, sorry about missing the notifications for this. Thank you!

@marcandre
Copy link
Contributor

Released as v1.46.0

@koic koic deleted the support_rubocop_ast_complex_node branch July 16, 2025 11:03
koic added a commit to rubocop/rubocop that referenced this pull request Jul 18, 2025
5hun-s pushed a commit to 5hun-s/rubocop that referenced this pull request Jul 21, 2025
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