djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.27k stars 212 forks source link

Warn about unused template files #162

Open P-E-Meunier opened 5 years ago

P-E-Meunier commented 5 years ago

I love this project! However, as a web project evolves, it is not uncommon for old template files to accumulate and ultimately become dead code.

It would be very cool if Askama could issue a warning when this is the case.

djc commented 5 years ago

Glad you like it! Are you going to use it for the Pijul web interface?

Unfortunately I don't think there is a straightforward way to do so. The only way I can think of would involve parsing all the source code and all the templates in a build script, which would be complex to maintain and slow down your compiles.

P-E-Meunier commented 5 years ago

Right now it's for another (smaller) project, but yes, I'm seriously considering it for the Nest.

djc commented 5 years ago

Nice -- let me know if you need anything to make it work.