-
Notifications
You must be signed in to change notification settings - Fork 646
Add 'file' option for lintOnSave setting #1965
Conversation
src/goLint.ts
Outdated
*/ | ||
export function goLint(fileUri: vscode.Uri, goConfig: vscode.WorkspaceConfiguration, lintWorkspace?: boolean): Promise<ICheckResult[]> { | ||
export function goLint(fileUri: vscode.Uri, goConfig: vscode.WorkspaceConfiguration, lintWorkspace?:boolean, lintFile?: boolean): Promise<ICheckResult[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 2 separate variables to manage scope feels excessive. Why not use a single variable, say scope
? This can have one of the 4 values file
, package
, workspace
, off
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I was wondering about this. I took your advice and passed a string value around. It cleans up the signatures.
I appreciate the feedback 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @brainsnail,
I have added one comment on the code. Please do take a look.
Apart from that, the linter is failing due to some extra trailing spaces.
Format the files to get rid of that.
You can also run npm run lint
in the end to make sure there are no linting errors.
Also, dont forget to register for the Microsoft Hacktoberfest :)
Thanks! |
What was added
What was tested
I sideloaded the extension then tested the following linters in
"go.lintOnSave"
file
mode by adding some unused variables and uncommented functions in a Go project.golint
gometalinter
megacheck
golangci-lint
revive
Please let me know if there's anything I've overlooked or if anything be improved. Thanks!