thoughtbot / thoughtbot/factory_bot

Lint: multiple factory definitions that make the same object

Open
#1,644 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
8.2k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Idea for a lint: complain if two factory definitions create the same object. This is a goal towards these ideals:

  • each factory definition is the minimum required to make the object
  • anything additional is added via traits

We'll need to consider factories that make e.g. Hash, String, Array -- either by letting the user turn off the linter for them, or by recognizing them as OK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the project's existing lint implementation and how factory definitions are represented, then determine how duplicate created objects and exceptions such as Hash, String, and Array should be handled. Done means the lint detects redundant factory definitions with a documented way to allow intentional cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.