{"id":13396793,"url":"https://github.com/go-critic/go-critic","last_synced_at":"2025-03-13T23:31:48.366Z","repository":{"id":32327005,"uuid":"132232698","full_name":"go-critic/go-critic","owner":"go-critic","description":"The most opinionated Go source code linter for code audit.","archived":false,"fork":false,"pushed_at":"2024-08-22T21:15:03.000Z","size":3800,"stargazers_count":1821,"open_issues_count":113,"forks_count":114,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-22T23:14:19.254Z","etag":null,"topics":["conventions","go","go-lintpack","golang","hacktoberfest","idiomatic-go","linter","lintpack","ruleguard","style-checker"],"latest_commit_sha":null,"homepage":"https://go-critic.com","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/go-critic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-05-05T09:17:26.000Z","updated_at":"2024-08-22T21:15:07.000Z","dependencies_parsed_at":"2023-12-03T11:20:58.408Z","dependency_job_id":"5111d58b-a557-4566-8c78-94e9e6223cd6","html_url":"https://github.com/go-critic/go-critic","commit_stats":{"total_commits":802,"total_committers":84,"mean_commits":9.547619047619047,"dds":0.7581047381546134,"last_synced_commit":"cd7da9a0e1b67ebbfd6a54bbf3be190902b6e760"},"previous_names":["pieselbois/kfulint"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-critic%2Fgo-critic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-critic","download_url":"https://codeload.github.com/go-critic/go-critic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500196,"owners_count":20300757,"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":["conventions","go","go-lintpack","golang","hacktoberfest","idiomatic-go","linter","lintpack","ruleguard","style-checker"],"created_at":"2024-07-30T18:01:03.298Z","updated_at":"2025-03-13T23:31:47.704Z","avatar_url":"https://github.com/go-critic.png","language":"Go","funding_links":[],"categories":["Library","Code Analysis","代码分析","开源类库","Open source library","Linters","Go","Repositories","Programming Languages","相关工具","相关工具`go相关工具和插件`","Libraries for creating HTTP middlewares"],"sub_categories":["Routers","路由器","代码分析","Code Analysis","Misc"],"readme":"# go-critic\n\n![Build Status](https://github.com/go-critic/go-critic/workflows/Go/badge.svg)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#code-analysis)\n[![Go Report Card][go-report-image]][go-report-url]\n[![coverage][coverage-image]][coverage-url]\n[![PRs Welcome][pr-welcome-image]][pr-welcome-url]\n\n[go-report-image]: https://goreportcard.com/badge/github.com/go-critic/go-critic\n[go-report-url]: https://goreportcard.com/report/github.com/go-critic/go-critic\n[coverage-image]: https://coveralls.io/repos/github/go-critic/go-critic/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/go-critic/go-critic?branch=master\n[pr-welcome-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg\n[pr-welcome-url]: https://github.com/go-critic/go-critic/blob/master/CONTRIBUTING.md\n\nHighly extensible Go source code linter providing checks currently missing from other linters.\n\n![Logo](https://avatars1.githubusercontent.com/u/40007520?s=300\u0026u=b44287d8845a63fb0102d5259710c11ea367bb13\u0026v=4)\n\nThere is never too much static code analysis. Try it out.\n\n## Features\n\n* Almost 100 diagnostics that check for [bugs](https://go-critic.github.io/overview#checkers-from-the-diagnostic-group), [performance](https://go-critic.github.io/overview#checkers-from-the-performance-group) and [style](https://go-critic.github.io/overview#checkers-from-the-style-group) issues\n* Extensible without re-compilation with [dynamic rules](https://quasilyte.dev/blog/post/ruleguard/)\n* Includes `#opinionated` checks with very strict and specific requirements\n* Self-documented: `gocritic doc \u003ccheckname\u003e` gives a checker description\n\n## Documentation\n\nThe latest documentation is available at [go-critic.com](https://go-critic.com/overview).\n\n## Installation\n\nFor most users, using `go-critic` under [golangci-lint](https://github.com/golangci/golangci-lint) is enough.\n\nPrecompiled `go-critic` binaries can be found at [releases](https://github.com/go-critic/go-critic/releases) page.\n\nIt can be installed in the usual Go way by running:\n```bash\ngo install -v github.com/go-critic/go-critic/cmd/gocritic@latest\n```\n\nTo build `go-critic` from sources, clone this repository and run `make gocritic`.\n\nOn macOS, you can also install `go-critic` using [MacPorts](https://www.macports.org): `sudo port install go-critic`\n\n## Usage\n\nBe sure `gocritic` executable is under your `$PATH`.\n\nUsage of **gocritic**: `gocritic [sub-command] [sub-command args...]`\nRun `gocritic` without arguments to get help output.\n\n```\nSupported sub-commands:\n\tcheck - run linter over specified targets\n\t\t$ gocritic check -help\n\t\t$ gocritic check -v -enable='paramTypeCombine,unslice' strings bytes\n\t\t$ gocritic check -v -enable='#diagnostic' -disable='#experimental,#opinionated' ./...\n\tversion - print linter version\n\t\t$ gocritic version\n\tdoc - get installed checkers documentation\n\t\t$ gocritic doc -help\n\t\t$ gocritic doc\n\t\t$ gocritic doc checkerName\n```\n\n`check` sub-command examples:\n\n```bash\n# Runs all stable checkers on `fmt` package:\ngocritic check fmt\n\n# Run all stable checkers on `pkg1` and `pkg2`\ngocritic check pkg1 pkg2\n\n# Run all stable checkers on `fmt` package and configure rangeExprCopy checker\ngocritic check -@rangeExprCopy.sizeThreshold 128 fmt\n\n# Runs specified checkers on `fmt` package:\ngocritic check -enable elseif,paramName fmt\n\n# Run all stable checkers on current dir and all its children recursively:\ngocritic check ./...\n\n# Like above, but without `appendAssign` check:\ngocritic check -disable=appendAssign ./...\n\n# Run all stable checkers on `foo.go` file:\ngocritic check foo.go\n\n# Run stable diagnostics over `strings` package:\ngocritic check -enable='#diagnostic' -disable='#experimental' strings\n\n# Run all stable and non-opinionated checks:\ngocritic check -enableAll -disable='#experimental,#opinionated' ./src/...\n```\n\n\u003e To get a list of available checker parameters, run `gocritic doc \u003ccheckerName\u003e`.\n\nIn place of a single name, **tag** can be used. Tag is a named checkers group.\n\nTags:\n* `#diagnostic` - kind of checks that detect various errors in code\n* `#style` - kind of checks that find style issues in code\n* `#performance` - kind of checks that detect potential performance issues in code\n* `#experimental` - check is under testing and development. Disabled by default\n* `#opinionated` - check can be unwanted for some people. Disabled by default\n* `#security` -  kind of checks that find security issues in code. Disabled by default and empty, so will fail if enabled.\n\n## Contributing\n\nThis project aims to be contribution-friendly.\n\nOur chats: [English](https://t.me/go_critic_eng) or\n[Russian](https://t.me/go_critic_ru)\n([Telegram website](https://telegram.org/))\n\nWe're using an optimistic merging strategy most of the time.\nIn short, this means that if your contribution has some flaws, we can still merge it and then\nfix them by ourselves. Experimental and work-in-progress checkers are isolated, so nothing bad will happen.\n\nCode style is the same as in Go project, see [CodeReviewComments](https://go.dev/wiki/CodeReviewComments).\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\nIt also describes how to develop a new checker for the linter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-critic%2Fgo-critic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-critic%2Fgo-critic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-critic%2Fgo-critic/lists"}