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

[new-rule] formatting specifiers in .each test names #359

Open
ark120202 opened this issue Jul 31, 2019 · 2 comments
Open

[new-rule] formatting specifiers in .each test names #359

ark120202 opened this issue Jul 31, 2019 · 2 comments
Labels
each support Relates to supporting the `each` method enhancement help wanted new rule

Comments

@ark120202
Copy link

In .each test (and describe block) names it's possible to use printf-like formatting.
I would like to have a new rule (or 2 rules) that would:

  • Enforce usage of at least one specifier in .each test name (should it be a part of no-identical-title?)
  • Disallow usage of these specifiers in regular test names, since it likely means it was left from some older version of test
@jeysal
Copy link
Member

jeysal commented Jul 31, 2019

Good idea. Would recommend not putting it into no-identical-title because a config option seems weird for a completely separate part of rule logic. Might want to include both suggestions in one though since they share the format string parsing of test names.

@petr-motejlek
Copy link

I was just today trying to see whether no-identical-title would help me remember to put at least : %p at the end of my .each blocks :).

Turns out it doesn't, and +1 to this issue -- having any way to force myself to not forget, would be great, regardless if it's the no-identical-title or any other rule that I have to enable.

Cheers

@G-Rath G-Rath changed the title Rule proposal: Formatting specifiers in .each test names [new-rule] formatting specifiers in .each test names Aug 27, 2022
@G-Rath G-Rath added each support Relates to supporting the `each` method enhancement labels Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
each support Relates to supporting the `each` method enhancement help wanted new rule
Projects
None yet
Development

No branches or pull requests

4 participants