https://github.com/comby-tools/go-patterns
Find-and-replace patterns for the Go language.
https://github.com/comby-tools/go-patterns
Last synced: 4 months ago
JSON representation
Find-and-replace patterns for the Go language.
- Host: GitHub
- URL: https://github.com/comby-tools/go-patterns
- Owner: comby-tools
- License: apache-2.0
- Created: 2020-10-20T03:35:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-24T07:25:28.000Z (almost 4 years ago)
- Last Synced: 2025-04-02T05:22:39.832Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Find-and-replace patterns for the Go language.
Find curated `comby` patterns for replacing certain Go patterns in this repo. These patterns aim to:
- generate virtually zero false positives (i.e., every match should be something you can act on improving)
- match/replace code that can be objectively better (i.e., not stylistically controversial)
If you find that a pattern doesn't do this effectively, please file an issue.
## Current patterns
- `go-staticcheck.toml`: a subset of 22 patterns inspired by simple [staticcheck](https://staticcheck.io/docs/checks) patterns.
## Running
- `comby -config go-staticcheck.toml -f .go` finds matches
- `comby -config go-staticcheck.toml -f .go -i` replaces file contents
- **You should run `gofmt` after running the above**
Exclude `vendor` and `.` directories with:
- `comby -config go-staticcheck.toml -f .go -i -exclude-dir vendor,.`