A comprehensive batch of lint rules for Go, shared across all your repos. - wangjohn/levenshtein

1 points•johnjwang•about 9 hours ago•0 comments•
Hey HN, I've been recently building a lot of Go projects and noticed myself setting up lint rules and CI/CD and starting from scratch each time. Also, if I found a good deterministic check to use in one repo, I'd have a hard time putting that in my other repos.

So I built Levenshtein (https://github.com/wangjohn/levenshtein). It's a curated set of Go lint rules and verification checks that run locally and in CI.

The rule set is pretty comprehensive and builds on Staticcheck and other existing analyzers, with some additional rules of my own. It includes:

- Go vet - Staticcheck - Modernize - Bug finding analyzers - Vulnerability / security analyzers

There's also some fun optional checks that you can configure like:

- Semantic linters using Jev - Race detectors - Mutation testing for tests - and many more!

I've been hooking it up to my own projects and caught dozens of bugs already. For example, one finding was a test that simulated database changes with os.WriteFile but ignored whether the writes succeeded.

Would love feedback, particularly about the default rules and what should be default/what shouldn't!

0 comments

No comments yet.

Read the full thread on Hacker News →

Related stories