r/ChatGPTCoding • u/ChiaraStellata • 2h ago
Resources And Tips Custom linters are powerful
Ask your agent to review your bug database and/or commit history and construct custom linters that statically detect common classes of bugs you've fixed in the past. Include some way of suppressing false positives then drive number of lint errors down to zero, adding regression tests along the way to prove the issues are real. Then refine your linters to be more precise and drive suppressions down as well, leaving only the most complex semantic suppressions. Run this in CI on both new changes and upstream rebases. Rely on robust linters built on sophisticated AST analysis rather than just fragile regexes, and as they start to share common underlying analyses, build them into a centralized pipeline that reuses intermediate analyses and intermediate representations to save runtime and LOC, much like a compiler. This is the path toward incremental formal mathematical verification of your codebase. (You can also condense down agent instructions that become statically enforced!)
I just did this on my codebase for the first time this holiday weekend and found literally hundreds of real issues in a legacy codebase. It's shocking.
2
u/Far_Reindeer8428 2h ago
we turned three review comments into lint rules and the agent stopped repeating them. the linter is the only reviewer that never gets tired
2
u/shetritr 1h ago
good one. a cheap check that each rule is real: run it against the parent of the commit that fixed that bug. if it doesn't fire on the old code, it's a rule the agent wrote to look busy. probably part of why yours found hundreds that held up