Commit Graph

42 Commits

Author SHA1 Message Date
Aldo Borrero
338c997326 wip: migration to clap 2022-12-12 19:12:36 +00:00
BMG
897bf115b1
feat: replace custom log with env_logger (#199) 2022-12-12 00:06:23 +01:00
zimbatm
cead31451e
Release v0.5.0 2022-12-01 18:22:02 +01:00
zimbatm
e7918e97ce
Release v0.4.1 2022-05-03 10:47:19 +02:00
zimbatm
9f9d61344c
Release v0.4.0 2022-05-02 20:11:58 +02:00
zimbatm
871b10dba4
Release v0.3.0 2021-12-17 18:56:55 +01:00
zimbatm
98460a8da0
Release v0.2.6 2021-08-31 17:12:54 +02:00
zimbatm
ff9f9601e1
Release v0.2.5 2021-08-14 17:33:42 +02:00
zimbatm
71ab126019
Release v0.2.4 2021-08-14 17:10:06 +02:00
zimbatm
f212b0ab7e
Release v0.2.3 2021-08-04 13:02:17 +02:00
zimbatm
233f472aa3
Release v0.2.2 2021-05-31 18:09:42 +02:00
zimbatm
5ce49c01f6
fix cargo publish 2021-05-08 20:41:55 +02:00
zimbatm
5f16a36e63
Release v0.2.1 2021-05-08 20:31:01 +02:00
zimbatm
c70100ee00
ci: automate the release publication
This still requires us to create a release commit, tag and push it.
2021-05-08 20:30:35 +02:00
zimbatm
6173e11662
Cargo.toml: fix metadata 2021-05-07 19:22:33 +02:00
zimbatm
c61f47f0f1
Release v0.2.0 2021-05-07 19:18:39 +02:00
zimbatm
797b80e98d
Release v0.1.1 2021-04-24 14:13:24 +02:00
Jonas Chevalier
8de1add053
implement --stdin (#95)
* implement --stdin

A first pass at making --stdin work

* use the tempfile crate
2021-03-05 10:49:21 +01:00
Basile Henry
38201beb21
Update Cargo.toml 2021-03-02 11:00:28 +01:00
zimbatm
77034594a6
Cargo.toml: add basile 2021-03-02 10:15:34 +01:00
Jonas Chevalier
8a2c84e786
license: fix attribution (#72) 2021-03-01 17:47:38 +01:00
zimbatm
c9bc5c63c9
only run formatters if there are files to format
Add more debugging. Take the baseline from ~500millis to ~60millis.
2021-02-25 19:21:33 +01:00
zimbatm
4991a97d37
use directories
Use OS-specific locations for the cache directory to make treefmt
cross-platform.
2021-02-25 14:48:13 +01:00
zimbatm
732439aff6
re-implement the core logic
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.
2021-02-25 14:48:13 +01:00
Jonas Chevalier
08681ac464
implement our own expand_path (#67)
path-absolutize's absolutize_virtually was actually failing if path is
already absolute and not under the reference directory. But we just want
to expand the path and make sure it's absolute and clean.
2021-02-25 11:14:56 +01:00
zimbatm
0748cd21af
Cargo: remove unused either 2021-02-23 09:13:26 +01:00
zimbatm
7881fdc210
Cargo: replace hex with stdlib fmt 2021-02-23 09:11:00 +01:00
zimbatm
c1bb7d073c
Cargo: remove unused glob package 2021-02-23 09:08:30 +01:00
zimbatm
1f5c7c30f1
Cargo: optimize path-absolutize
Now that all the uses of std::env::set_current_dir have been removed, we
can add a bit of caching in that crate.
2021-02-22 14:09:34 +01:00
zimbatm
09d40f4539
cli: make sure the work_dir is absolute
Since we do a lot of path manipulation, with commands changing
directories and whatnot. It's probably easier to work with only absolute
paths.

If we can guarantee that, the rest will become easier.
2021-02-22 13:01:05 +01:00
Basile Henry
190d447c0f Setup benchmark
`criterion` is a powerful benchmark crate that works on rust stable.

This commit sets up a basic benchmark to get things started and
understand the performance of the program better.
2021-02-20 11:08:24 +01:00
Andika Demas Riyandi
3ad67a3851
adding working directory option on prjfmt.toml for each formatter (#59)
* adding working directory option on prjfmt.toml for each formatter

* rename workdir into work_dir

* switch from xshell into process::Command

* fix unordered command_context by changing to BTreeMap
2021-02-19 17:02:33 +01:00
Jonas Chevalier
08d9fcf21f
rename to treefmt (#56) 2021-02-15 20:22:03 +00:00
zimbatm
8702ac12d7
remove unused env_logger crate 2021-02-06 20:51:32 +01:00
Jonas Chevalier
3fa53f31e6
replace 'which' with crate (#42)
The binary is not available on all platforms.
2021-02-06 19:13:24 +00:00
Basile Henry
58074d9c30 Use ignore for better control over globbing
resolves #13: Includes and excludes
resolves #24: Follows .gitgnore directives
2021-01-28 10:34:13 +01:00
Andika Demas Riyandi
cae48808b5 Cleaned up package dependencies 2021-01-27 17:43:45 +07:00
Basile Henry
5a4d0099df Run formatters in parallel
All the formatters are run in parallel using rayon's powerful par_iter
which uses a thread pool under the hood.
2021-01-26 22:00:15 +01:00
Andika Demas Riyandi
19f77cf969
rename project, adding cache mechanism (#12)
* rename project, adding cache mechanism

* refactor code and finalize cachin evaluation

* fix caching evaluation and manifest creation
2021-01-25 15:01:08 +01:00
Andika Demas Riyandi
431a174b9d fix new fmt.toml parsing 2021-01-07 17:27:17 +07:00
Andika Demas Riyandi
621ddac2af
adding an command to add/check (#1)
* adding an  command to add/check

* Make cargo fmt working on rust folder

* fix the build with `nix develop -i`

Co-authored-by: zimbatm <zimbatm@zimbatm.com>
2021-01-01 11:53:16 +00:00
Andika Demas Riyandi
9a47dad8b1 initial the project with basic Nix and Rust files 2020-12-18 17:26:56 +07:00