How to ignore some rails_best_practices gem warnings?

I use metric_fu and rails_best_practices metrics for my applications. But this time, I was assigned an old project that has been under development for more than 1 year.

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

The problem is that I cannot find the alerts that I created through all these hundreds of alerts . I do not want to correct all of these warnings right now. I just want to correct my new warnings and note the old warnings so I can check them in the future.

Is there any way to ignore these old warnings?

+4
source share
1 answer

Yes, you can ignore warnings.

Run rails_best_practices -g . This will create the rails_best_practices.yml configuration rails_best_practices.yml .

You can delete or comment on one review to disable it, and you can change the settings.

You can apply the ignored_files parameter to any rule by specifying a regular expression or an array of regular expressions that describe the path to files that you do not want to check:

 DefaultScopeIsEvilCheck: { ignored_files: 'user\.rb' } LongLineCheck: { max_line_length: 80, ignored_files: ['db/migrate', 'config/initializers'] } 
+3
source

Source: https://habr.com/ru/post/1380384/


All Articles