{"id":13695847,"url":"https://github.com/UrbanCompass/thriftlint","last_synced_at":"2025-05-03T13:33:36.975Z","repository":{"id":62978612,"uuid":"78586856","full_name":"UrbanCompass/thriftlint","owner":"UrbanCompass","description":"An extensible linter for Thrift","archived":false,"fork":false,"pushed_at":"2019-01-17T00:35:42.000Z","size":18,"stargazers_count":40,"open_issues_count":0,"forks_count":8,"subscribers_count":396,"default_branch":"master","last_synced_at":"2024-08-03T18:20:02.742Z","etag":null,"topics":["golang","linter","thrift","thrift-lint"],"latest_commit_sha":null,"homepage":null,"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/UrbanCompass.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":"2017-01-11T00:19:43.000Z","updated_at":"2024-01-11T18:28:16.000Z","dependencies_parsed_at":"2022-11-10T07:00:19.262Z","dependency_job_id":null,"html_url":"https://github.com/UrbanCompass/thriftlint","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/UrbanCompass%2Fthriftlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanCompass%2Fthriftlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanCompass%2Fthriftlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UrbanCompass%2Fthriftlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UrbanCompass","download_url":"https://codeload.github.com/UrbanCompass/thriftlint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224364409,"owners_count":17299066,"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":["golang","linter","thrift","thrift-lint"],"created_at":"2024-08-02T18:00:34.033Z","updated_at":"2024-11-12T23:31:05.432Z","avatar_url":"https://github.com/UrbanCompass.png","language":"Go","readme":"# An extensible linter for Thrift [![](https://godoc.org/github.com/UrbanCompass/thriftlint?status.svg)](http://godoc.org/github.com/UrbanCompass/thriftlint)\n\nThis is an extensible linter for [Thrift](https://thrift.apache.org/). It\nincludes a set of common lint checks, but allows for both customisation of those\nchecks, and creation of new ones by implementing the\n[Check](https://godoc.org/github.com/UrbanCompass/thriftlint#Check) interface.\n\nFor an example of how to build your own linter utility, please refer to the\n[thrift-lint source](https://github.com/UrbanCompass/thriftlint/tree/master/cmd/thrift-lint).\n\n## Example checker\n\nHere is an example of a checker utilising the `MakeCheck()` convenience\nfunction to ensure that fields are present in the file in the same order as\ntheir field numbers:\n\n```go\nfunc CheckStructFieldOrder() thriftlint.Check {\n  return thriftlint.MakeCheck(\"field.order\", func(s *parser.Struct) (messages thriftlint.Messages) {\n    fields := sortedFields(s.Fields)\n    sort.Sort(fields)\n    for i := 0; i \u003c len(fields)-1; i++ {\n      a := fields[i]\n      b := fields[i+1]\n      if a.Pos.Line \u003e b.Pos.Line {\n        messages.Warning(fields[i], \"field %d and %d are out of order\", a.ID, b.ID)\n      }\n    }\n    return\n  })\n}\n```\n\n## thrift-lint tool\n\nA binary is included that can be used to perform basic linting with the builtin checks:\n\n```\n$ go get github.com/UrbanCompass/thriftlint/cmd/thrift-lint\n$ thrift-lint --help\nusage: thrift-lint [\u003cflags\u003e] \u003csources\u003e...\n\nA linter for Thrift.\n\nFor details, please refer to https://github.com/UrbanCompass/thriftlint\n\nFlags:\n      --help                Show context-sensitive help (also try --help-long\n                            and --help-man).\n  -I, --include=DIR ...     Include directories to search.\n      --debug               Enable debug logging.\n      --disable=LINTER ...  Linters to disable.\n      --list                List linter checks.\n      --errors              Only show errors.\n\nArgs:\n  \u003csources\u003e  Thrift sources to lint.\n```\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUrbanCompass%2Fthriftlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUrbanCompass%2Fthriftlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUrbanCompass%2Fthriftlint/lists"}