gofmt -w
all the thingsThis is a program that walks around Github, grabs Go repos, clones 'em, and runs gofmt -w .
on 'em.
If after running the notorious gofmt, changes have been (eg. git status
is dirty), then it adds, commits,
forks, pushes, and finally puts a PR up.
If you're one of the maintainers or owners of a project and I've bothered you or messed up in my proposed change, please file an issue so this work can be as helpful and positive as possible.
I've been running with some configured blacklisted regex's (like vendor/ dirs) to exclude from the git add
portion to try to keep changes pertinent.
Want to run it yourself? Cool!
To run it, you need:
.gofmt-att.json
file. There's a lot of options in there. Pick your poison."EnvToken": "GITHUB_TOKEN"
field in the bespoke file.git push
. Usernaming-and-passwording isn't currently supported. So figure your ssh shit or whatever out. The program will try to use the CloneURL
field from the Github API for pushing your changes to your fork.Run:
go run main.go run
go run main.go config
and friends to dump or write a default configMore about configuration and other stuff.
Rob Pike touching on gofmt: https://www.youtube.com/watch?v=PAAkCSZUG1c&t=8m43s