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 cop to ensure 'skip' has a message #198

Closed
fatkodima opened this issue Nov 19, 2022 · 1 comment · Fixed by #199
Closed

New cop to ensure 'skip' has a message #198

fatkodima opened this issue Nov 19, 2022 · 1 comment · Fixed by #199
Labels
enhancement New feature or request

Comments

@fatkodima
Copy link
Contributor

fatkodima commented Nov 19, 2022

Inspired by - https://hexdocs.pm/credo/Credo.Check.Design.SkipTestWithoutComment.html.

It is possible to skip a test without providing a reason why - https://github.com/minitest/minitest/blob/ed224bc9983eab31cbb4859f655daeec903da046/lib/minitest/assertions.rb#L783

Future you or other developers will have a hard time figuring out why it was skipped. So I suggest to enforce skip messages. Unless it is in condition already.

Example

# bad
skip

# good
skip("Is not supported by Active Record < 7")

# also good
skip if active_record_below_7?
@andyw8
Copy link
Contributor

andyw8 commented Nov 21, 2022

Seems like a useful cop 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants