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

Suppress Lint/AmbiguousOperatorPrecedence offense #207

Merged

Conversation

koic
Copy link
Member

@koic koic commented Sep 3, 2021

This PR suppresses the following Lint/AmbiguousOperatorPrecedence offense.

% bundle exec rake
(snip)

Offenses:

lib/rubocop/ast/node.rb:428:44: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
return true if special_keyword? || send_type? && prefix_not?
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
spec/rubocop/ast/node_pattern/lexer_spec.rb:70:27: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
expect(types).to eq [:tNODE_TYPE] * 2 + [:tPARAM_CONST] * 7
                    ^^^^^^^^^^^^^^^^^
spec/rubocop/ast/node_pattern/lexer_spec.rb:70:47: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
expect(types).to eq [:tNODE_TYPE] * 2 + [:tPARAM_CONST] * 7
                                        ^^^^^^^^^^^^^^^^^^^

162 files inspected, 3 offenses detected, 3 offenses auto-correctable

https://github.com/rubocop/rubocop-ast/pull/206/checks?check_run_id=3501466011

This PR suppresses the following `Lint/AmbiguousOperatorPrecedence` offense.

```console
% bundle exec rake
(snip)

Offenses:

lib/rubocop/ast/node.rb:428:44: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
return true if special_keyword? || send_type? && prefix_not?
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
spec/rubocop/ast/node_pattern/lexer_spec.rb:70:27: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
expect(types).to eq [:tNODE_TYPE] * 2 + [:tPARAM_CONST] * 7
                    ^^^^^^^^^^^^^^^^^
spec/rubocop/ast/node_pattern/lexer_spec.rb:70:47: W: [Correctable]
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying
precedence with parentheses to avoid ambiguity.
expect(types).to eq [:tNODE_TYPE] * 2 + [:tPARAM_CONST] * 7
                                        ^^^^^^^^^^^^^^^^^^^

162 files inspected, 3 offenses detected, 3 offenses auto-correctable
```

https://github.com/rubocop/rubocop-ast/pull/206/checks?check_run_id=3501466011
@koic koic force-pushed the suppress_ambiguous_operator_precedence_offense branch from 9a6a00e to cefc56a Compare September 10, 2021 04:28
@koic koic merged commit 8b5c259 into rubocop:master Sep 10, 2021
@koic koic deleted the suppress_ambiguous_operator_precedence_offense branch September 10, 2021 09:18
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

1 participant