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
PR #8042 Introduced a change that flagged mismatched format as an offense, but I believe it doesn't take into account the escaped %. Something like %% %{foo}s should be valid as it has a named component, but the first part is just escaping a % sign.
Expected behavior
No offense when pairing a named format with an escaped %. Other combinations with an escaped % may need to be checked.
Actual behavior
Offense flagged with Lint/FormatParameterMismatch: Format string is invalid because formatting sequence types (numbered, named or unnumbered) are mixed
Steps to reproduce the problem
Something like format('%%%<hex>02X', hex: 10) -> %0A should be valid. This format string does not throw errors when run.
Got another false positive for this cop: "%{code} - %{message}" % { code: 42, message: "wut" }. If I understood correctly, this string has only named sequences.
PR #8042 Introduced a change that flagged mismatched format as an offense, but I believe it doesn't take into account the escaped %. Something like
%% %{foo}s
should be valid as it has a named component, but the first part is just escaping a % sign.Expected behavior
No offense when pairing a named format with an escaped %. Other combinations with an escaped % may need to be checked.
Actual behavior
Offense flagged with
Lint/FormatParameterMismatch: Format string is invalid because formatting sequence types (numbered, named or unnumbered) are mixed
Steps to reproduce the problem
Something like
format('%%%<hex>02X', hex: 10)
-> %0A should be valid. This format string does not throw errors when run.RuboCop version
The text was updated successfully, but these errors were encountered: