Closed gburt closed 1 year ago
btw thanks for this work, we're very glad to have it helping make our code better!
Thanks very much for the thorough PR. Looks good to me but it seems there are some failing tests. Could you please take a look?
doh I'd just been running go test -run TestAnalyzer/check_blanks
and hadn't noticed the other test failures
now we just need to make a "you visited AssignStmt but not GenDecl" linter :)
Waiting for #221 to merge before merging this.
I noticed that
var foo, _ = bar()
blanks weren't getting checked becauseast.GenDecl
statements (a subset of which arevar
declarations) weren't being handled/visited. Fix that, and add back the analyzer tests for blank (and assert) flags.To handle them, I refactored the existing assignment check. It's completely unchanged except it now takes LHS and RHS args that we feed it from both the GenDecl and AssignStmt nodes' values.