jhawthorn / actionview_precompiler

Precompiles ActionView templates at app boot for Rails 6+
MIT License
144 stars 11 forks source link

Include filename in compilation errors #45

Closed camertron closed 1 month ago

camertron commented 3 months ago

I was working in the GitHub dotcom monolith today and noticed a bunch of CI failures with CompilationError stack traces from actionview_precompiler. The failures were happening because of a missed git merge conflict in a Rails template I had mistakenly committed. Unfortunately the CompilationErrors didn't mention the filename of the template that failed to parse, so I had no idea which template was to blame. I opened up the code and modified it to pass the filename down to where the error was raised and was ultimately able to find and correct the merge conflict. I thought it would be a nice improvement to upstream my changes 😄

camertron commented 3 months ago

Hah I see @HParker did something similar in https://github.com/jhawthorn/actionview_precompiler/pull/27, although it does not appear to include the filename in CompilationErrors.

jhawthorn commented 1 month ago

Thank you!