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: Overhaul/FactoryBoundaries #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Drowze
Copy link
Contributor

@Drowze Drowze commented Mar 15, 2024

This is an opt-in cop that should help extracting from an application into a (micro?) service. It flags usage of configured factories outside the configured paths. E.g.:

# rubocop.yml
Overhaul/FactoryBoundaries:
  Enabled: true
  Factories:
    apple:
      - '**/food_service/**/*.rb'
# # bad:
# spec/car_service/apple_spec.rb
create(:apple)
 

# # good:
# spec/food_service/apple_spec.rb
create(:apple)

@Drowze Drowze force-pushed the rg-factory-boundaries-cop branch from c729bd2 to 08dfaf1 Compare March 16, 2024 02:14
@Drowze Drowze force-pushed the rg-factory-boundaries-cop branch from 08dfaf1 to 2183afe Compare March 16, 2024 03:34
Copy link
Contributor

@skcc321 skcc321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

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

Successfully merging this pull request may close these issues.

2 participants