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
For numbers in scientific notation, at least two different styles are widely used, normalized scientific notation and engineering notation. Enforcing one of those styles by default is IMO too intrusive.
lambda1=400e-9distance=12.5e-2
rubocop 1.60.2:
Style/ExponentialNotation: Use a mantissa in [1, 10[.
By default, the cop is enabled and enforces normalized scientific notation.
But depending on the field, engineering notation might be more common.
It might even make sense to use neither of those two (e-2 for distances in cm).
Enabling it by default makes it necessary to add yet another configuration setting.
Expected behavior
RuboCop should not report this by default, Style/Exponential Notation should be disabled.
Personally inclined to respect writer's intentions, this proposal seems acceptable.
@tdeo You have proposed the Style Guide rule rubocop/ruby-style-guide#811 and its implementation #7851 for this issue. Do you have any thoughts on this matter?
While I don't have a strong personal attachment to the rule, I do believe consistency is king when it comes to using that notation to help the reader.
Given the very low amount of times this has been discussed over nearly 4 years, I do believe the current configuration is reasonable enough even though it won't please 100% of people
For numbers in scientific notation, at least two different styles are widely used, normalized scientific notation and engineering notation. Enforcing one of those styles by default is IMO too intrusive.
rubocop 1.60.2:
By default, the cop is enabled and enforces normalized scientific notation.
But depending on the field, engineering notation might be more common.
It might even make sense to use neither of those two (e-2 for distances in cm).
Enabling it by default makes it necessary to add yet another configuration setting.
Expected behavior
RuboCop should not report this by default, Style/Exponential Notation should be disabled.
Actual behavior
Style/Exponential Notation is enabled by default.
Steps to reproduce the problem
See example above.
RuboCop version
The text was updated successfully, but these errors were encountered: