{"id":17837012,"url":"https://github.com/peakle/go-rules","last_synced_at":"2025-04-02T13:21:36.865Z","repository":{"id":65594732,"uuid":"595170673","full_name":"peakle/go-rules","owner":"peakle","description":"Go syntax linter","archived":false,"fork":false,"pushed_at":"2023-02-09T11:13:48.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T04:27:08.382Z","etag":null,"topics":["go","golang","linter","static-analysis","syntax-analysis"],"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/peakle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-01-30T14:45:34.000Z","updated_at":"2023-06-08T19:24:49.000Z","dependencies_parsed_at":"2023-02-16T09:16:12.864Z","dependency_job_id":null,"html_url":"https://github.com/peakle/go-rules","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakle%2Fgo-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakle%2Fgo-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakle%2Fgo-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakle%2Fgo-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peakle","download_url":"https://codeload.github.com/peakle/go-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819805,"owners_count":20839098,"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","linter","static-analysis","syntax-analysis"],"created_at":"2024-10-27T20:45:00.008Z","updated_at":"2025-04-02T13:21:36.843Z","avatar_url":"https://github.com/peakle.png","language":"Go","readme":"# go-rules\n\nGo rules linter\n\n[![Tests](https://github.com/peakle/go-rules/workflows/Tests/badge.svg)](https://github.com/peakle/go-rules/blob/master/.github/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/peakle/go-rules)](https://goreportcard.com/report/github.com/peakle/go-rules)\n[![Go Reference](https://pkg.go.dev/badge/github.com/peakle/go-rules.svg)](https://pkg.go.dev/github.com/peakle/go-rules)\n\n### How to use:\n\nFull installation example: https://github.com/peakle/dc-rules-example\n\n1. Install rules:\n      ```shell\n      go get -v github.com/peakle/go-rules\n      ```\n2. Create rules.go file in your project like\n   in [example](https://github.com/peakle/go-rules/tree/master/example/rules.go)\n3. Add linter to your pipeline:\n    1. Like another one check in golangci-lint (will work for golangci-lint \u003ev1.46.0):\n\n        ``` yaml\n        linters:\n          enable:\n            - gocritic\n        linters-settings:\n          gocritic:\n            enabled-checks:\n              - ruleguard\n            settings:\n              ruleguard:\n                rules: \"YourDir/rules.go\"\n        ```\n    2. Like explicit check WITHOUT golangci-lint:\n        1. install binary by `curl` or `go install`:\n           ```shell\n           curl -sSfL https://raw.githubusercontent.com/peakle/go-rules/master/releaser/install.sh | sh -s -- -d -b $(go env GOPATH)/bin latest\n           ```\n           OR\n           ``` shell\n           go install -v github.com/peakle/go-rules/cmd/goRules@latest\n           ```\n        2. Run lint:\n           ``` shell\n           goRules ./...\n           ```\n    3. Like file watcher in Goland IDE (will work for golangci-lint \u003ev1.46.0):\n        1. add golangci-lint as `File Watcher` in IDE (Preferences -\u003e Tools -\u003e File Watchers -\u003e Add)\n        2. set `Arguments` field where `.golangci.yml` file will be like example above:\n           ```\n           run $FileDir$ --config=$ProjectFileDir$/.golangci.yml\n           ```\n\n### How to update to new rules version:\n\n1. update rules version in your go.mod file\n2. download new rules version:\n   ```shell\n   go get github.com/peakle/go-rules@newVersion\n   ```\n3. if you using golangci-lint update cache:\n   ```shell\n   golangci-lint cache clean\n   ```\n\n### How to add new checks:\n\n1. Ruleguard tour for newbees: https://go-ruleguard.github.io/by-example\n2. Fork repo \u0026\u0026 open PR :D\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakle%2Fgo-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeakle%2Fgo-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakle%2Fgo-rules/lists"}