We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
invalid?
!valid?
unless @valid?
A new cop to check for the usage of invalid? instead of !valid? when no conditions are given.
The cop should suggest the following change:
-[email protected]? +@user.invalid?
-unless @user.valid? +if @user.invalid?
This is inspired by Rails/Blank
Rails/Blank
[Correctable] Rails/Blank: Use if @user.blank? instead of unless @user.present?
The text was updated successfully, but these errors were encountered:
Wouldn't custom extending config for Style/InverseMethods be enough? - https://github.com/rubocop/rubocop/blob/ed00a87a77e3d05119f451b745dc951c5834f368/config/default.yml#L4012-L4037
Style/InverseMethods
Sorry, something went wrong.
[Fix rubocop#914] Make Style/InverseMethods aware of valid? and `…
valid?
ecd9fbe
…invalid?` methods Fixes rubocop#914. This commit makes `Style/InverseMethods` aware of `valid?` and `invalid?` methods.
Merge pull request #936 from koic/make_style_inverse_methods_aware_of…
e179054
…_valid_and_invalid [Fix #914] Make `Style/InverseMethods` aware of `valid?` and `invalid?` methods
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
A new cop to check for the usage of
invalid?
instead of!valid?
when no conditions are given.Describe the solution you'd like
The cop should suggest the following change:
Additional context
This is inspired by
Rails/Blank
The text was updated successfully, but these errors were encountered: