charkost / prosopite

:mag: Rails N+1 queries auto-detection with zero false positives / false negatives
Apache License 2.0
1.48k stars 45 forks source link

Ignore specific files #49

Closed vitobotta closed 1 year ago

vitobotta commented 1 year ago

Hi! Is it possible somehow to ignore specific files, such as FactoryBot's factories? Thanks :)

dpaluy commented 1 year ago

There are 2 options I have found so far:

  1. When I use create_list, I Prosopite.pause
  2. Overwrite create_list method to include the first solution
let(:articles) do
  Prosopite.pause
  articles = create_list(:articles, 4)
  Prosopite.resume
  articles
end
charkost commented 1 year ago
Prosopite.allow_stack_paths = ['substring_in_call_stack', /regex/]

Can probably do the job too.