You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, when the state of the repo is cached, modifications to the prjfmt.toml file are not used until the repo is modified because prjfmt assumes everything is already formatted.
I assume that if a formatter is updated/version changed, then a similar issue where prjfmt will assume it doesn't need to run arises.
This logic of cache invalidation can probably become complicated, maybe we could just add a command to the CLI to let the user invalidate the cache manually: prjfmt --clear-cache?
The text was updated successfully, but these errors were encountered:
I think this can be fixed with the following changes:
expand the path of the formatter binary to get an absolute value. Record that into the manifest.
record the mtime of the formatted binary
when checking if a file has "changed", also compare the command that has been used.
That should capture 99% of the cases.
There is still the issue that the formatters themselves might have a config file that gets changed so adding the --clear-cache option will be necessary.
The cache should compare (cmd, mtime) instead of just the time. That way if the command changes or a new version of the software is installed, it will re-run the formatter.
At the moment, when the state of the repo is cached, modifications to the
prjfmt.toml
file are not used until the repo is modified becauseprjfmt
assumes everything is already formatted.I assume that if a formatter is updated/version changed, then a similar issue where
prjfmt
will assume it doesn't need to run arises.This logic of cache invalidation can probably become complicated, maybe we could just add a command to the CLI to let the user invalidate the cache manually:
prjfmt --clear-cache
?The text was updated successfully, but these errors were encountered: