{"id":47211292,"url":"https://github.com/abhijit-hota/modfmt","last_synced_at":"2026-03-13T15:46:40.634Z","repository":{"id":243303454,"uuid":"811929191","full_name":"abhijit-hota/modfmt","owner":"abhijit-hota","description":"Tidy up your go.mod files by merging the require blocks","archived":false,"fork":false,"pushed_at":"2026-01-05T11:38:45.000Z","size":325,"stargazers_count":16,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-06T17:55:20.514Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":"https://github.com/abhijit-hota/modfmt","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhijit-hota.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T15:27:04.000Z","updated_at":"2026-03-03T12:43:09.000Z","dependencies_parsed_at":"2024-06-12T20:26:13.473Z","dependency_job_id":null,"html_url":"https://github.com/abhijit-hota/modfmt","commit_stats":null,"previous_names":["abhijit-hota/modmerge","abhijit-hota/modfmt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhijit-hota/modfmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhijit-hota%2Fmodfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhijit-hota%2Fmodfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhijit-hota%2Fmodfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhijit-hota%2Fmodfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhijit-hota","download_url":"https://codeload.github.com/abhijit-hota/modfmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhijit-hota%2Fmodfmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30469416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang"],"created_at":"2026-03-13T15:46:40.037Z","updated_at":"2026-03-13T15:46:40.617Z","avatar_url":"https://github.com/abhijit-hota.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `modfmt`\n\nThis tool merges require blocks in `go.mod` files since [`go mod tidy` doesn't do it](https://github.com/golang/go/issues/56471). \nIt also separates the direct and indirect dependencies and sorts them alphabetically.\n\n| Before                       | After                       |\n|------------------------------|-----------------------------|\n| \u003cimg src=\"docs/before.png\"/\u003e | \u003cimg src=\"docs/after.png\"/\u003e |\n\n## Installation\n\n```sh\ngo install github.com/abhijit-hota/modfmt@latest\n```\n\n## Usage\n\nThe binary outputs the formatted `go.mod` to standard output.\n\nAlternatively, you can use the `--in-place` flag to replace the contents of the `go.mod` file in place.\n\nIn your Go project root, run:\n```sh\nmodfmt --in-place\n```\n\nThe `--check` command will override other flags, and will instead return a non-zero exit code if the `go.mod` file is\nnot formatted, or zero if it is already formatted. This is useful for validating `go.mod` files in CI pipelines.\n```sh\nmodfmt --check\n```\n\n## Limitations\n\nI hacked this tool together using the official parser in less than 2 hours and unsurprisingly there are a few drawbacks with this:\n\n- `require` blocks come last after using this. Can be fixed with little effort I think?\n- Comments in `require` blocks are not preserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhijit-hota%2Fmodfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhijit-hota%2Fmodfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhijit-hota%2Fmodfmt/lists"}