Skip to content

Commit

Permalink
feat: Enable gopls static analyzers
Browse files Browse the repository at this point in the history
This is the list of enabled analyzers:

    fieldalignment
    nilness
    unusedparams
    unusedvariable
    unusedwrite
    useany

The analyzers that weren't enabled have too high a risk of false
positives.
  • Loading branch information
ryboe committed Apr 23, 2023
1 parent 2bc6d97 commit 9daf262
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
"gopls": {
"formatting.gofumpt": true,
"ui.completion.usePlaceholders": true,
"ui.diagnostic.analyses": {
"fieldalignment": true,
"nilness": true,
"unusedparams": true,
"unusedvariable": true,
"unusedwrite": true,
"useany": true
},
"ui.diagnostic.staticcheck": true,
"ui.semanticTokens": true
}
},
Expand Down
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"go.toolsManagement.autoUpdate": true,
"gopls": {
"formatting.gofumpt": true,
"ui.completion.usePlaceholders": true
"ui.completion.usePlaceholders": true,
"ui.diagnostic.analyses": {
"fieldalignment": true,
"nilness": true,
"unusedparams": true,
"unusedvariable": true,
"unusedwrite": true,
"useany": true
},
"ui.diagnostic.staticcheck": true,
"ui.semanticTokens": true
}
}

0 comments on commit 9daf262

Please sign in to comment.