flyerhzm / rails_best_practices

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

Problem when using rails_best_practices with Overcommit #351

Open Diego-Zulu opened 4 years ago

Diego-Zulu commented 4 years ago

Hey there!

Some weeks ago I tried out the RailsBestPractices hook with Overcommit to no avail. I opened an issue to ask about my problem, and it turns out it may be related to how rails_best_practices expect explicit files to be passed. However, I still have not found the cause of the problem.

I tried running this (which is what overcommit ends up running to my understanding):

echo app/controllers/application_controller.rb config/routes.rb | tr ',' '\n' | xargs bundle exec rails_best_practices

And this works perfectly (by this I mean it detectes warnings in those two files correctly), so I don't really know what could be going wrong with that.

Can anyone give me a hand with this? Thanks!