-
Notifications
You must be signed in to change notification settings - Fork 38
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
what are the stdio flags that a plugin needs to support ? #425
Comments
I got a Test harness setup but: treefmt . --verbose -vv --on-unmatched debug
DEBU format: config-file=/Users/apple/workspace/go/src/numtide__treefmt/.test/dsh/treefmt.toml tree-root=/Users/apple/workspace/go/src/numtide__treefmt/.test/dsh
DEBU cache: formatter '%s' has changed dsh=size 2473522=modTime 2024-10-05 19:16:22.402481699 +1000 AEST=cachedSize 2420530=cachedModTime 2024-10-05 18:28:44.353360791 +1000 AEST="missing value"
DEBU format | dsh: match: /Users/apple/workspace/go/numtide__treefmt/.test/dsh/test-02-sub.dsh
DEBU format | dsh: match: /Users/apple/workspace/go/numtide__treefmt/.test/dsh/test-02.dsh
DEBU format: no formatter for path: test-dsh.toml
DEBU format | dsh: match: /Users/apple/workspace/go/numtide__treefmt/.test/dsh/test.dsh
DEBU format: no formatter for path: treefmt.toml
DEBU cache: finished generating change set in 124.375µs
DEBU format | dsh: executing: /Users/apple/workspace/go/numtide__treefmt/.dep/dshfmt -w test-02-sub.dsh test-02.dsh test.dsh
ERRO format | dsh: failed to apply with options '[-w]': exit status 2
dsh error:
flag provided but not defined: -w
Usage of /Users/apple/workspace/go/src/numtide__treefmt/.bin/dshfmt
-dump
dump raw parsed data
-fsort
show keyword frequencies
-i string
indent (default "\t")
-ksort
show keyword counts
-v verbose diagnostics
dshfmt is my binary. Seems it needs -w to be supported and then sub call into one of my current args that are above maybe ? |
If dshfmt wrapping another formatter? Try changing it so it takes the list of files to format as an argument, and then writes the result directly to the file if the content has changed. Here is a small wrapper in case dshfmt is a wrapper
|
Thanks !! dshfmt Is golang binary with stdio support . it only supports a single file at a time being passed in as the arg with no flag . If you happen to know I am golang example I am look at that . prefer not to have to use a bank wrapper as then it will not work on all OS .. |
1 similar comment
Thanks !! dshfmt Is golang binary with stdio support . it only supports a single file at a time being passed in as the arg with no flag . If you happen to know I am golang example I am look at that . prefer not to have to use a bank wrapper as then it will not work on all OS .. |
Hey,
pretty cool stuff.
I have a file format that is just a text format for a Science Project, and wrote a golang based Fmt thing that parses the file and spits out into via STDOUT.
I had a look at the docs at https://treefmt.com/formatter-spec, but did not see the stdio args needed.
Can you let me know the args for input and output that it needs to support to work with treefmt ?
The text was updated successfully, but these errors were encountered: