flyerhzm / rails_best_practices

a code metric tool for rails projects
http://rails-bestpractices.com
MIT License
4.16k stars 276 forks source link

Can't ignore partials when applying ReplaceInstanceVariableWithLocalVariableCheck rule #223

Open ivanoblomov opened 10 years ago

ivanoblomov commented 10 years ago

I'd like to ignore a particular view partial when evaluating the ReplaceInstanceVariableWithLocalVariableCheck rule.

I've tried every obvious permutation in config/rails_best_practices.yml, but nothing works...

ReplaceInstanceVariableWithLocalVariableCheck: { ignored_files: '_admin_form.html.slim' } ReplaceInstanceVariableWithLocalVariableCheck: { ignored_files: '.admin.form.html.slim' } ReplaceInstanceVariableWithLocalVariableCheck: { ignored_files: /_admin_form.html.slim/ } ReplaceInstanceVariableWithLocalVariableCheck: { ignored_files: 'app/views/.admin.form.html.slim' } ReplaceInstanceVariableWithLocalVariableCheck: { ignored_files: 'app/views/**/_admin_form.html.slim' }

Help?

flyerhzm commented 10 years ago

@ivanoblomov this is the code to check if ignoring a file, https://github.com/railsbp/rails_best_practices/blob/master/lib/rails_best_practices/core/check.rb#L49, could you help me debug it?

ivanoblomov commented 10 years ago

Sure thing, Richard. Let me know what I can do.

Fovea Central, now at the App Store. http://FoveaCentral.com

On Oct 2, 2014, at 10:55 AM, Richard Huang notifications@github.com wrote:

@ivanoblomov this is the code to check if ignoring a file, https://github.com/railsbp/rails_best_practices/blob/master/lib/rails_best_practices/core/check.rb#L49, could you help me debug it?

— Reply to this email directly or view it on GitHub.

flyerhzm commented 10 years ago

@ivanoblomov could you add some code and run rails_best_practices to see why it doesn't ignore your file?