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

re-implement the core logic #68

Merged
merged 8 commits into from
Feb 25, 2021
Merged

re-implement the core logic #68

merged 8 commits into from
Feb 25, 2021

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