{"id":13837205,"url":"https://github.com/edsrzf/gofmt-git-hook","last_synced_at":"2025-06-11T08:34:05.893Z","repository":{"id":1080918,"uuid":"926490","full_name":"edsrzf/gofmt-git-hook","owner":"edsrzf","description":"A Git pre-commit hook that checks formatting of Go code","archived":false,"fork":false,"pushed_at":"2018-04-09T05:02:10.000Z","size":243,"stargazers_count":135,"open_issues_count":3,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T03:22:49.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"orcaman/concurrent-map","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edsrzf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-09-21T00:45:06.000Z","updated_at":"2025-03-07T14:23:51.000Z","dependencies_parsed_at":"2022-07-06T06:01:46.187Z","dependency_job_id":null,"html_url":"https://github.com/edsrzf/gofmt-git-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edsrzf%2Fgofmt-git-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edsrzf%2Fgofmt-git-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edsrzf%2Fgofmt-git-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edsrzf%2Fgofmt-git-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edsrzf","download_url":"https://codeload.github.com/edsrzf/gofmt-git-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edsrzf%2Fgofmt-git-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259230321,"owners_count":22825391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:01:03.307Z","updated_at":"2025-06-11T08:34:05.869Z","avatar_url":"https://github.com/edsrzf.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"This project contains two scripts intended to be used as git pre-commit hooks.\n\nThe first, fmt-check, prevents you from committing if you need to run gofmt on any\nmodified .go file.\n\nThe second, fmt-fix, runs all modified .go files through gofmt before committing.\nNOTE: This script does not play well when adding partial changes, such as with\n`git add -p` or `git commit -p`.\n\nYou should use either one or the other, not both.\n\nBoth scripts are originally based on a [golang-nuts discussion][1].\n\nTo install in a single repository, copy a script to .git/hooks/pre-commit and make\nsure it's executable.\n\nYou might also find it useful to create a git alias for gofmt by running:\n\n    git config --global alias.gofmt '!echo $(git diff --cached --name-only --diff-filter=ACM | grep '.go$') | xargs gofmt -w -l | xargs git add'\n\nThen you can run git gofmt and format all modified .go files. Note that this alias\nwill not handle situations where partial file changes have been added to the index.\n\n[1]: http://groups.google.com/group/golang-nuts/browse_thread/thread/bcd1b0e3c75c3884/5ce342b06ea29d03\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedsrzf%2Fgofmt-git-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedsrzf%2Fgofmt-git-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedsrzf%2Fgofmt-git-hook/lists"}