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

Design evaluation cache #8

Closed
zimbatm opened this issue Jan 18, 2021 · 1 comment
Closed

Design evaluation cache #8

zimbatm opened this issue Jan 18, 2021 · 1 comment

Comments

@zimbatm
Copy link
Member

zimbatm commented Jan 18, 2021

A great idea by @Rizary.

Since prjfmt is responsible for traversing the filesystem, it can also keep track of the mtimes of each file during the classification. By doing so, it's possible to not re-format files that haven't changed.

The project needs to be changed to:

Load a cache file if it exists. The location should be $XDG_CACHE_DIR/prjfmt/eval-cache/<hex(hash(path))>.toml where path is the path to the prjfmt.toml file.

When traversing the filesystem, compare to the cache and remove all the files that haven't changed.

After formatting, check again the mtimes of the files that have been potentially touched. Update the cache with all the files.

@Rizary
Copy link
Contributor

Rizary commented Jan 25, 2021

closed by #12

@Rizary Rizary closed this as completed Jan 25, 2021
brianmcgee added a commit that referenced this issue May 13, 2024
Closes #8

Signed-off-by: Brian McGee <brian@bmcgee.ie>

Reviewed-on: https://git.numtide.com/numtide/treefmt/pulls/16
Reviewed-by: Jonas Chevalier <zimbatm@noreply.git.numtide.com>
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
brianmcgee added a commit that referenced this issue May 13, 2024
feat: set nix package version to shortRev
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

2 participants