-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Another Style/FormatStringToken false positive #5630
Comments
Fixes rubocop#5630. This PR fixes a false positive for `Style/FormatStringToken` when using placeholder arguments in `format` method.
Fixes #5630. This PR fixes a false positive for `Style/FormatStringToken` when using placeholder arguments in `format` method.
Just upgraded to |
@katherine-boost I was working on this cop for the 0.75 release. What error exactly are you seeing? |
Thanks for your reply @buehmann The error:
The line of code provoking the error: formatted_cents = format('%02d', cents % 100) |
@katherine-boost That is not an error. The cop behaves as designed. With style formatted_cents = format('%02<remainder>d', remainder: cents % 100) Also see https://docs.rubocop.org/en/stable/cops_style/#styleformatstringtoken |
Hello, just wanted to post another issue in here. When I set this in my
I'm getting this error:
I'm not sure if I am able to switch these to the template style, because I believe that is only for strings, while I need to use the |
@ndbroadbent Good point. Would you mind creating a new issue for this? Template style has indeed no way I know to influence the type conversion. By the way, it seems to accept non-strings as an argument, but does not simply do |
Github didn't let @lionel218 open this issue for some reason. See the original report at #5245 (comment)
Expected behavior
no offense from
Style/FormatStringToken
Actual behavior
Steps to reproduce the problem
Use this file:
RuboCop version
The text was updated successfully, but these errors were encountered: