Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore some rails_best_practices gem warnings?

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?

like image 922
Mahmoud Khaled Avatar asked Nov 09 '11 12:11

Mahmoud Khaled


1 Answers

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'] } 
like image 164
Jogger Avatar answered Nov 10 '22 00:11

Jogger