How to ignore some rails_best_practices gem warnings?

2.7k Views Asked by At

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?

1

There are 1 best solutions below

0
On

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'] }