rails_best_practices icon indicating copy to clipboard operation
rails_best_practices copied to clipboard

Can't ignore partials when applying ReplaceInstanceVariableWithLocalVariableCheck rule

Open ivanoblomov opened this issue 10 years ago • 3 comments

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?

ivanoblomov avatar Sep 12 '14 15:09 ivanoblomov

@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?

flyerhzm avatar Oct 02 '14 14:10 flyerhzm

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 [email protected] 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.

ivanoblomov avatar Oct 02 '14 15:10 ivanoblomov

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

flyerhzm avatar Oct 03 '14 00:10 flyerhzm