incu6us / goimports-reviser

Right imports sorting & code formatting tool (goimports alternative)
MIT License
600 stars 72 forks source link

Several flags don't work when using ./... as a target #93

Closed erinwild closed 1 year ago

erinwild commented 1 year ago

I'm trying to set both -list-diff and -set-exit-status while using ./... as the target, but they don't seem to work. Instead changes are written to all files with no list of files outputted to stdout or with an exit status.

goimports-reviser -list-diff -set-exit-status ./...

I also tried goimports-reviser -list-diff $(find . -type f -name '*.go') which worked with goimports, but it just lists the first file.

Is there a way to set either of these while also targeting all .go files in my repo?

devenami commented 1 year ago
for file in `find . -type f -name '*.go'`
do
goimports-reviser -list-diff -set-exit-status $file
done

You can use the script above to replace

LittleCuteBug commented 9 months ago

the pull request #126 haven't resolve this issue goimports-reviser -set-exit-status ./... and several flags still not work

micaelmalta commented 5 months ago

the pull request #126 haven't resolve this issue goimports-reviser -set-exit-status ./... and several flags still not work

Fix on https://github.com/incu6us/goimports-reviser/pull/157