8

I am using metric_fu and rails_best_practices gems for my applications. But this time I was assigned to an old project that was under development for more than 1 year.

When I used rails_best_practices gem to generate warnings, I found hundreds of warnings.

The problem is that I can't find warnings generated by myself through all these hundreds of warnings. I don't want to fix all these warnings right now. I just want to fix my new warnings and mark the old warnings to check them in the future.

Is there any method to ignore these old warnings?

Mahmoud Khaled
  • 6,226
  • 6
  • 37
  • 42

1 Answers1

8

Yes you can ignore the warnings.

Run rails_best_practices -g. This will generate configuration file rails_best_practices.yml.

You can remove or comment one review to disable it, and you can change the options.

You can apply the ignored_files option on any rule by giving a regexp or array of regexps describing the path of the files you don't want to be checked:

DefaultScopeIsEvilCheck: { ignored_files: 'user\.rb' }
LongLineCheck: { max_line_length: 80, ignored_files: ['db/migrate', 'config/initializers'] } 
Jogger
  • 397
  • 5
  • 15