-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Cop Idea: Repeated Description in Same Example Group #258
Comments
@andyw8 @bquorning @dgollahon what do you think? |
I haven't run into this very often, but I see no problem with adding a check for it. |
@backus: I think it's interesting and probably helpful for writing more descriptive tests. I wonder if it should be enabled by default or at what sensitivity though--It might be a little much to have every duplicate flagged by default. It would be interesting to see how many offenses you get on popular / large codebases. |
@dgollahon true. I'll try it on our private codebase and a few others I contribute to see how many false positives there are. |
If you can put on a branch, I can try running it on some repos too. |
This cop found a few violations in rubocop-rspec that I fixed :) |
I ran this cop on rubocop's specs. I think rubocop/rubocop#3828 demonstrates that this cop is pretty helpful. |
Implemented in #259 |
This issue is very common: rubocop/rubocop#3816 (comment)
Basically, it is easy for people to bootstrap tests they write by copying the previous and forgetting to change the description string. We should consider flagging this if the repeated description is not inside a new
context
,description
,shared_example
, etc.The text was updated successfully, but these errors were encountered: