{"id":17760593,"url":"https://github.com/mariocarrion/nit","last_synced_at":"2025-03-15T09:31:43.679Z","repository":{"id":34567660,"uuid":"159756296","full_name":"MarioCarrion/nit","owner":"MarioCarrion","description":"Opinionated code organization linter for Go projects.","archived":true,"fork":false,"pushed_at":"2023-03-27T07:01:02.000Z","size":300,"stargazers_count":21,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T16:48:38.903Z","etag":null,"topics":["go","golang","golang-tools","lint","linter","linting","nitpick","styleguide"],"latest_commit_sha":null,"homepage":"","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/MarioCarrion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"MarioCarrion"}},"created_at":"2018-11-30T02:21:40.000Z","updated_at":"2025-01-20T21:40:00.000Z","dependencies_parsed_at":"2024-06-20T02:56:10.887Z","dependency_job_id":"5c350521-5470-4029-837a-bf59f8627d9b","html_url":"https://github.com/MarioCarrion/nit","commit_stats":null,"previous_names":["mariocarrion/nitpicking"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioCarrion%2Fnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioCarrion%2Fnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioCarrion%2Fnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioCarrion%2Fnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarioCarrion","download_url":"https://codeload.github.com/MarioCarrion/nit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713357,"owners_count":20335564,"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":["go","golang","golang-tools","lint","linter","linting","nitpick","styleguide"],"created_at":"2024-10-26T19:06:09.696Z","updated_at":"2025-03-15T09:31:43.402Z","avatar_url":"https://github.com/MarioCarrion.png","language":"Go","funding_links":["https://github.com/sponsors/MarioCarrion"],"categories":[],"sub_categories":[],"readme":"# nit\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/MarioCarrion/nit)](https://goreportcard.com/report/github.com/MarioCarrion/nit)\n[![Circle CI](https://circleci.com/gh/MarioCarrion/nit.svg?style=svg)](https://circleci.com/gh/MarioCarrion/nit)\n[![coverage](https://gocover.io/_badge/github.com/MarioCarrion/nit?0 \"coverage\")](http://gocover.io/github.com/MarioCarrion/nit)\n\n`nit` is an opinionated Code Organization linter for Go.\n\nIt defines a collection of rules to determine how each Go file should be organized internally.\n\n## Rules\n\n1. [X] `imports` is the first section\n   - [X] Requires parenthesized declaration,\n   - [X] One maximum, and\n   - [X] Separated in 3 blocks: standard, external and same package (local).\n1. [X] `type` is the second section\n   - [X] Requires parenthesized declaration,\n   - [X] Section must be sorted: exported first, then unexported; and\n   - [X] Supports `//-` comment for separating groups\n1. [X] `const` is the third section\n   - [X] Requires parenthesized declaration,\n   - [X] Multiple allowed, and\n   - [X] Section must be sorted: exported first, then unexported.\n1. [X] `var` is the fourth section\n   - [X] Requires parenthesized declaration, and\n   - [X] Section must be sorted: exported first, then unexported.\n1. [X] `func` is the fifth section\n   - [X] Must be sorted, exported first, then unexported, and\n   - [X] Supports `//-` comment for separating groups.\n1. [X] `func` method, is the sixth section\n   - [X] Must be sorted by type, exported first, then unexported; and\n   - [X] Supports `//-` comment for separating groups.\n\nFancy State Machine explaining the rules above:\n\n![code](code.png \"code organization in file\")\n\n## Installing\n\n* Using `go` (\u003e= 1.13): `go get github.com/MarioCarrion/nit/cmd/nit@v0.6.0`, for installing v0.6.0 for example; see the releases for other versions.\n* Using it as a dependency with the [`tools.go` paradigm](https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md):\n\n```go\n// +build tools\n\npackage tools\n\nimport (\n\t_ \"github.com/MarioCarrion/nit/cmd/nit\"\n)\n```\n\n## Using\n\nAfter installing you can use:\n\n```\nnit -pkg \u003cbase local package\u003e $(go list ./...)\n```\n\nPlease use `nit -h` for other available arguments.\n\n## Development requirements\n\nGo \u003e= 1.14.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariocarrion%2Fnit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariocarrion%2Fnit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariocarrion%2Fnit/lists"}