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

FEATURE: Add a cop that checks for potential fabricator shorthand use #40

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jan 26, 2024

Background

In discourse/discourse#24314, @danielwaterworth introduced the ability to use #fab! with a shorthand when simply fabricating a vanilla record with the same name as the assigned let, e.g.:

fab!(:user) { Fabricate(:user) }

can become:

fab!(:user)

What is this cop?

This PR introduces a cop that highlights places where this shorthand can be used.

@Drenmi Drenmi merged commit da85422 into main Feb 20, 2024
2 checks passed
@Drenmi Drenmi deleted the feature/fabricator-shorthand-cop branch February 20, 2024 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants