Closed renoire closed 1 year ago
I can reproduce the issue by changing the repo:
$ git diff
diff --git a/examples/go/main.go b/examples/go/main.go
index c048119..6e81588 100644
--- a/examples/go/main.go
+++ b/examples/go/main.go
@@ -2,6 +2,8 @@ package main
import "fmt"
-func main() {
+func main()
+
+{
fmt.Println("hello world")
}
$ treefmt -C examples/go/
$ echo $?
1
$ gofmt examples/go/
examples/go/main.go:7:1: unexpected semicolon or newline before {
Treefmt should display the error
This changed in the last release. With treefmt v0.4.0:
$ treefmt
[INFO]: Error using formatter #go:
• [STDOUT]:
• [STDERR]:
/home/zimbatm/go/src/github.com/numtide/treefmt/examples/go/main.go:7:1: unexpected semicolon or newline before {
[ERR]: #go's formatter failed: exit status 2
@brianmcgee this behaviour changed in 897bf115b136eaa67fa79051465bc5c37d298a0e
@zimbatm I can have a look later today
Fix available #207
Copy paste error when switching the log framework. Default log level should be Warn
not Off
.
I run the command in a dir where there's a go file which looks like this (the curly brace on a new line):
There's zero output, however I would expect it to forward the formatter error message to the console. Same with any other file contents not matching go, but having a .go extension.