discover-unused-partials icon indicating copy to clipboard operation
discover-unused-partials copied to clipboard

No support for slim?

Open nbdavies opened this issue 7 years ago • 2 comments

I have a file called something like:

app/views/things/partials/_view_thing_stuff.html.slim

It was returned as "unused", though doing a code search, I found instances where it was being rendered with this syntax:

<%= render partial: 'things/partials/view_thing_stuff' %>

I did notice a typo on this line of discover-unused-partials.rb:

EXT = %w(.html.erb .text.erb .erb .html.haml .text.haml .haml .rhtml .html.slim slim)

There's no period before "slim". I'm not 100% sure this is the cause. This is the only place in the gem that HAML is explicitly mentioned though, so if it works for one, it should probably work for the other.

If this is the root cause, that would mean that it's not matching on .html.slim, it's only matching on .slim even though the file ends in .html.slim, and the same thing probably happens with .haml without anyone noticing.

nbdavies avatar Nov 21 '16 20:11 nbdavies

This issue is nearly a year old, but I found myself in the same situation. Are there any updates on this?

23tux avatar Oct 12 '17 21:10 23tux

There was a PR for that some time ago but looks like it didn't solve the problem entirely. Please provide a PR for it. :)

PotHix avatar Oct 13 '17 10:10 PotHix