convert only if the matcha file has been modified #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current behavior is to re-render the templates every time. It's not a problem for resource usage (matcha is crazy fast!) but I use gleam fix and gleam format on my codebase. So that means I need to run fix/format on the codebase after every matcha call. That's fine but fix/format apply to the whole src tree so I end up "fixing" files that are opened for editing in other windows.
I suppose getting perfectly formatted output would be one way to solve it! But that might be a bigger lift.
The solution I'm using is to check the dates of the
.gleam
and.matcha
files and only runconvert
if the matcha template was modified more recently.This could also be a flag you want to keep the default behavior.
Hopefully you find this useful, thanks for you work on matcha!