-
-
Notifications
You must be signed in to change notification settings - Fork 273
Handle RescuedExceptionsVariableName
with rescue_from
#49
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
Comments
RescuedExceptionsVariableName
with `rescue_fromRescuedExceptionsVariableName
with rescue_from
I think it is better to use |
anthony-robin
pushed a commit
to anthony-robin/rubocop-rails
that referenced
this issue
Oct 13, 2019
Follows rubocop/rubocop#7122 Closes rubocop#49 Inspired from @pocke [refactoring][1] in the `Naming/RescuedExceptionsVariableName` cop, this PR handle the `rescue_from` Rails version. Obstructing points: - As discussed [in this comment][2], the `PreferredName` config should not be duplicated but read from the `Naming/RescuedExceptionsVariableName` cop. How can I read the config from another cop ? Is there already some example of cop working this way ? - I haven't been able to make the parser to not take the `||` of the block arguments which make the offending message being `|my_var|` instead of `my_var`. What is the way to avoid this ? [1]: rubocop/rubocop#7122 [2]: rubocop#49 (comment)
8 tasks
anthony-robin
pushed a commit
to anthony-robin/rubocop-rails
that referenced
this issue
Oct 13, 2019
Follows rubocop/rubocop#7122 Closes rubocop#49 Inspired from @pocke [refactoring][1] in the `Naming/RescuedExceptionsVariableName` cop, this PR handle the `rescue_from` Rails version. Obstructing points: - As discussed [in this comment][2], the `PreferredName` config should not be duplicated but read from the `Naming/RescuedExceptionsVariableName` cop. How can I read the config from another cop ? Is there already some example of cop working this way ? - I haven't been able to make the parser to not take the `||` of the block arguments which make the offending message being `|my_var|` instead of `my_var`. What is the way to avoid this ? [1]: rubocop/rubocop#7122 [2]: rubocop#49 (comment)
ydakuka
pushed a commit
to ydakuka/rubocop-rails
that referenced
this issue
Feb 13, 2025
Follows rubocop/rubocop#7122 Closes rubocop#49 Inspired from @pocke [refactoring][1] in the `Naming/RescuedExceptionsVariableName` cop, this PR handle the `rescue_from` Rails version. Obstructing points: - As discussed [in this comment][2], the `PreferredName` config should not be duplicated but read from the `Naming/RescuedExceptionsVariableName` cop. How can I read the config from another cop ? Is there already some example of cop working this way ? - I haven't been able to make the parser to not take the `||` of the block arguments which make the offending message being `|my_var|` instead of `my_var`. What is the way to avoid this ? [1]: rubocop/rubocop#7122 [2]: rubocop#49 (comment)
ydakuka
added a commit
to ydakuka/rubocop-rails
that referenced
this issue
Feb 15, 2025
Ensures that rescued exception variables are named as expected. The `PreferredName` config option specifies the required name of the variable. Its default is `e`, as referenced from `Naming/RescuedExceptionsVariableName`.
9 tasks
ydakuka
added a commit
to ydakuka/rubocop-rails
that referenced
this issue
Feb 15, 2025
Ensures that rescued exception variables are named as expected. The `PreferredName` config option specifies the required name of the variable. Its default is `e`, as referenced from `Naming/RescuedExceptionsVariableName`.
ydakuka
added a commit
to ydakuka/rubocop-rails
that referenced
this issue
Feb 17, 2025
Ensures that rescued exception variables are named as expected. The `PreferredName` config option specifies the required name of the variable. Its default is `e`, as referenced from `Naming/RescuedExceptionsVariableName`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Following what have been done in the Naming/RescuedExceptionsVariableName cop in the rubocop repo, we should also handle the Rails version that use
rescue_from
:Should this cop read the configuration of
Naming/RescuedExceptionsVariableName
or have its own duplicated ?The text was updated successfully, but these errors were encountered: