Skip to content
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

Lint/FormatParameterMismatch triggers off format strings in arguments (ie strftime arguments) #8115

seandilda opened this issue Jun 8, 2020 · 2 comments


Copy link

@seandilda seandilda commented Jun 8, 2020

Lint/FormatParameterMismatch appears to trigger if the arguments include a string that appears to have format values in it.

Expected behavior

The cop should only complain if there are conflicting parameter types in the format string.

Actual behavior

If the format string has one type of parameter types and an argument to the format string appears to have another, the cop will trigger.

Steps to reproduce the problem

Run rubocop against a file with the following line:

format('%<time>s', time: time.strftime('%Y-%m-%d %H:%M:%S'))

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:

0.85.1 (using Parser, rubocop-ast 0.0.3, running on ruby 2.6.6 x86_64-linu
Copy link

@bbatsov bbatsov commented Jun 8, 2020

@andrykonchin can you look into this, please? I'm assuming it's related to the recent changes you did there.

andrykonchin added a commit to andrykonchin/rubocop that referenced this issue Jun 8, 2020
andrykonchin added a commit to andrykonchin/rubocop that referenced this issue Jun 8, 2020
Copy link

@andrykonchin andrykonchin commented Jun 8, 2020

@bbatsov Done

@koic koic closed this in #8119 Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.