You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def foo
begin
do_something_dangerous
rescue StandardError => e
@result = e
end
@result
end
The rucbocop says to use the famous e variable representing the error while the rubycritic says to use a better variable description. The result is a UncommunicativeVariableName, detailing my class with GoodCents::ImportCsv#build has the variable name 'e'
Ruby core team member here. Since RuboCop has moved away from enforcing the Ruby Style Guide and towards maximum configurability, the default configuration shouldn't be treated as an authoritative source on what is "good". In most cases the default is arbitrarily chosen by the author of the cop.
You can configure the desired variable name in your .rubocop.yml like so:
The rucbocop says to use the famous
e
variable representing the error while the rubycritic says to use a better variable description. The result is aUncommunicativeVariableName
, detailing my class withGoodCents::ImportCsv#build has the variable name 'e'
rubocop --version 1.18.3
rubycritic --version 4.6.1
If this is the properly place to discuss it, someone needs to reproduce it as well. Thanks in advantage.
The text was updated successfully, but these errors were encountered: