Add 'file' option for lintOnSave setting - #1965
Conversation
| * @param lintFile If true, runs linter on a single file. | ||
| */ | ||
| 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.
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.
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 😄
Ramya Rao (ramya-rao-a)
left a comment
There was a problem hiding this comment.
Hey logan (@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"filemode by adding some unused variables and uncommented functions in a Go project.golintgometalintermegacheckgolangci-lintrevivePlease let me know if there's anything I've overlooked or if anything be improved. Thanks!