Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing slim (or temple?) template files #142

Closed
oboxodo opened this issue Oct 8, 2021 · 7 comments
Closed

Support parsing slim (or temple?) template files #142

oboxodo opened this issue Oct 8, 2021 · 7 comments

Comments

@oboxodo
Copy link
Contributor

oboxodo commented Oct 8, 2021

It'd be nice to be able to include slim files, just like erb files are supported. Slim is actually built on top of Temple which is a generic templates parser/compiler. Maybe it would even be worth it to replace the existing erb parser with a temple parse as it includes erb built-in and you'd be getting support for many others all at once.

@exterm
Copy link
Contributor

exterm commented Oct 14, 2021

I don't know temple, but I'm pretty sure we don't want to add more parsers right now. We've actually discussed removing the erb parser.

If it can replace the existing parser, there's a chance that we'll merge it (but no promises, since the tool is very much in "maintenance only" mode from our side).

@oboxodo
Copy link
Contributor Author

oboxodo commented Oct 14, 2021

Fair enough. If you're considering removing the erb parser, then maybe you can instead extract it into a separate plugin-like gem so it can be used as a reference implementation for other potential parsers to be implemented?

@mclark
Copy link
Contributor

mclark commented Oct 14, 2021

We've actually discussed removing the erb parser.

I'd like to hear more about this plan/discussion. Would this mean that references to private constants from erb files would go undetected?

@exterm
Copy link
Contributor

exterm commented Oct 14, 2021

It's far from being decided, but Shopify has been replacing lots of erb with react frontends, so the question came up whether we should remove the erb parser. It won't happen any time soon though, and it might not happen at all (currently we still do have erb code and we want to keep analyzing that, and who knows if we'll ever completely get rid of it).

We also of course would take other user's needs into consideration.

Do I understand correctly that you're interested in continued erb support, Matt?

@mclark
Copy link
Contributor

mclark commented Oct 14, 2021

Do I understand correctly that you're interested in continued erb support, Matt?

Yes, for the foreseeable future at least GitHub is still using erb files and will need these constants to be detected.

@exterm
Copy link
Contributor

exterm commented Oct 14, 2021

Thank you for chiming in! Will keep that in mind if the topic comes up again.

@rafaelfranca
Copy link
Member

Closing since we don't have any interest on adding more parsers for packwerk. We are open to receive PRs making it easier to plugin different parsers if available though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants