Skip to content

re-implement the core logic#68

Merged
zimbatm merged 8 commits intomasterfrom
refactor-xxx
Feb 25, 2021
Merged

re-implement the core logic#68
zimbatm merged 8 commits intomasterfrom
refactor-xxx

Conversation

@zimbatm
Copy link
Member

@zimbatm zimbatm commented Feb 25, 2021

Re-implement the core logic to get it right. I had to remove the evaluation cache and parallel formatting for now in order to make this manageable.

  • Load the config
  • Prepare for filesystem traversal
  • Match each path against the formatters and collect the ones that match. Get the mtime from the traversal entry to avoid additional syscalls.
  • Now that we have a map from formatter to paths, run each formatter against its list. Collect a list of new mtimes.
  • Finally display the list of files that have changed.

@zimbatm zimbatm requested a review from rizary February 25, 2021 10:22
I had to remove the evaluation cache and parallel formatting for now in
order to make this manageable.

* Load the config
* Prepare for filesystem traversal
* Match each path against the formatters and collect the ones that
  match. Get the mtime from the traversal entry to avoid additional
  syscalls.
* Now that we have a map from formatter to paths, run each formatter
  against its list. Collect a list of new mtimes.
* Finally display the list of files that have changed.
Use OS-specific locations for the cache directory to make treefmt
cross-platform.
@zimbatm zimbatm force-pushed the refactor-xxx branch 2 times, most recently from 3c3f747 to 043bbcf Compare February 25, 2021 17:21
This is already handled by the formatter himself
Add more debugging. Take the baseline from ~500millis to ~60millis.
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

Successfully merging this pull request may close these issues.

1 participant