Skip to content

Commit 101e691

Browse files
authored
Merge pull request #1014 from koic/make_lint_redundant_safe_navigation_aware_of_several_methods
Make `Lint/RedundantSafeNavigation` aware of several methods
2 parents b70b1d8 + 4052e55 commit 101e691

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#1014](https://github.com/rubocop/rubocop-rails/pull/1014): Make `Lint/RedundantSafeNavigation` aware of `blank?`, `presence`, and `present?` methods. ([@koic][])

config/default.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ Lint/NumberConversion:
4848
- in_milliseconds
4949
AllowedPatterns: []
5050

51+
Lint/RedundantSafeNavigation:
52+
# Add `blank?`, `presence`, and `present?` methods to the default of the RuboCop core.
53+
# https://github.com/rubocop/rubocop/blob/v1.51.0/config/default.yml#L2148-L2159
54+
AllowedMethods:
55+
- instance_of?
56+
- kind_of?
57+
- is_a?
58+
- eql?
59+
- respond_to?
60+
- equal?
61+
- blank?
62+
- presence
63+
- present?
64+
5165
Rails:
5266
Enabled: true
5367
DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails

0 commit comments

Comments
 (0)