Brian McGee
9934a5764d
fix: --stdin flag
...
This was incorrectly ported from Rust to Go.
When provided, `treefmt` will take the contents of stdin and place them into the file provided with the `--stdin` flag, then format it according to the configured formatters.
If the file doesn't exist it is created. If it exists, it is first truncated and then populated with stdin.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-06-03 17:07:34 +01:00
Jonas Chevalier
e368d3ee80
Update docs/configure.md
...
Co-authored-by: Brian McGee <brian@bmcgee.ie>
2024-05-30 19:19:57 +02:00
Jonas Chevalier
f9a464ce5e
Update docs/configure.md
...
Co-authored-by: Brian McGee <brian@bmcgee.ie>
2024-05-30 19:19:51 +02:00
zimbatm
2575f2e143
docs: put motivation first
...
Explain why this project exists, before diving into it
2024-05-30 14:26:38 +02:00
zimbatm
7792121c95
docs: link to treefmt-nix instead of duplicating the examples
2024-05-30 14:26:38 +02:00
zimbatm
fccb46367c
docs: focus on the default experience in the quickstart
...
Most of the time you don't need the extra running options.
2024-05-30 14:26:38 +02:00
zimbatm
93955bbc3c
docs: document the global format
2024-05-30 14:26:38 +02:00
Brian McGee
bbe50fbe75
doc: refine --on-unmatched usage
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-29 10:32:02 +01:00
Brian McGee
1b517c6502
feat: add --on-unmatched
...
By default, if a path does not match any formatter a log message at WARN level will be emitted. A user can change this by providing the `--on-unmatched` or `-u` flag and specifying a log level `debug,info,warn,error,fatal`.
If fatal, the process will exit with an error on the first unmatched path encountered.
Closes #302
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-29 10:32:02 +01:00
Brian McGee
ce14ee828f
feat: simplify pipeline model
...
For each path we determine the list of formatters that are interested in formatting it. From there, we sort
the list of formatters first by priority (lower value, higher priority) and then by name (lexicographically).
With this information we create a batch key which is based on the unique sequence of formatters. When enough paths with the same sequence is ready we apply them in order to each formatter.
By default, with no special configuration, this model guarantees that a given path will only be processed by one formatter at a time.
If a user wishes to influence the order in which formatters are applied they can use the priority field.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-26 16:52:04 +01:00
Jonas Chevalier
a969e31956
docs: clearer landing page ( #298 )
...
I tried to make it clearer for fresh eyes what this project is about
2024-05-18 09:45:38 +02:00
Brian McGee
54d3cd004c
doc: fix license link in footer
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-13 10:40:02 +01:00
Brian McGee
c815a21f8d
doc: switch to treefmt.com domain
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-13 10:20:22 +01:00
Brian McGee
b11474ca2f
doc: fix copyright notice
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-13 10:07:18 +01:00
Brian McGee
4a8692414e
chore: change base url to treefmt instead of treefmt-go
...
In preparation for moving to the main treefmt repo.
Also fixes some broken links.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-12 19:39:43 +01:00
Brian McGee
e5da10e873
doc: refine docs and usage
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-10 10:46:39 +01:00
Brian McGee
ea6fe2d5cb
doc: improve treefmt.gif
...
Add some whitespace to each file in the examples folder before applying to demonstrate formatting occurring.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 20:04:13 +01:00
Brian McGee
aa2b9e8bc3
doc: fix social links
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 18:13:58 +01:00
Brian McGee
602751aabb
fix: rename treefmt.go to treefmt-go
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 16:30:24 +01:00
Brian McGee
78065811df
doc: set base url to work in github pages
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 16:16:09 +01:00
Brian McGee
e7f6bfa036
doc: explain re-write in Go
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 15:58:32 +01:00
Brian McGee
926c1b2039
doc: change project url to github.com/numtide/treefmt.go
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 13:30:40 +01:00
Brian McGee
b01ea779aa
doc: add init gif
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-03 13:27:02 +01:00
Brian McGee
aa07c0af2f
doc: add favicon
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 13:29:59 +01:00
Brian McGee
e3fabb17e8
doc: update usage with info about walkers.
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:52:29 +01:00
Brian McGee
352dfff6e1
doc: update stats in overview
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:52:29 +01:00
Brian McGee
92f8d58015
doc: update fmt.gif
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:52:17 +01:00
Brian McGee
ad3e66166a
feat: add flake compat
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:39 +01:00
Brian McGee
8e840a9a96
doc: refine installation
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:39 +01:00
Brian McGee
6070b6f6e4
doc: refine faq
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:39 +01:00
Brian McGee
4d60509e13
doc: refine contributing
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:39 +01:00
Brian McGee
d9ee97a0b7
doc: refine formatter spec
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
f1c80edcf1
doc: refine usage
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
17f354b880
doc: improve hero gif
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
2f557e364a
doc: refine overview
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
577c6086c0
doc: refine quick start content
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
311e46a409
doc: fix docs package build
...
Vitepress cli does some funky stuff with the tty.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:38 +01:00
Brian McGee
7cc49e2275
wip: add focs package
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
894f90f084
doc: move assets into public folder
...
Fixes issues with built version of the site
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
e252f6bd0c
doc: fix bad formatter spec link
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
fc8d8f31d1
doc: add footer
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
07989c7a04
doc: some initial experiments with colors
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
097b701792
doc: remove features on home page
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:37 +01:00
Brian McGee
482e4976fd
doc: update github link
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:36 +01:00
Brian McGee
73722737f6
doc: port existing content
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:36 +01:00
Brian McGee
b86d0f897f
doc: configure hero and logo
...
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-05-02 11:41:36 +01:00