Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Added commands "Go Lint Package" and "Go Lint Workspace"#1258

Merged
ramya-rao-a merged 6 commits intomicrosoft:masterfrom
ndrewnee:add-cmd-golint
Nov 9, 2017
Merged

Added commands "Go Lint Package" and "Go Lint Workspace"#1258
ramya-rao-a merged 6 commits intomicrosoft:masterfrom
ndrewnee:add-cmd-golint

Conversation

@ndrewnee
Copy link
Copy Markdown
Contributor

@ndrewnee ndrewnee commented Oct 1, 2017

Fixes #1041

@msftclas
Copy link
Copy Markdown

msftclas commented Oct 1, 2017

CLA assistant check
All CLA requirements met.

@ramya-rao-a ramya-rao-a force-pushed the master branch 2 times, most recently from 7259f77 to f6936fa Compare October 2, 2017 20:31
@ndrewnee ndrewnee closed this Oct 11, 2017
@ndrewnee
Copy link
Copy Markdown
Contributor Author

I don't know why happened this job error, so reopening pull request to trigger travis

@ndrewnee ndrewnee reopened this Oct 11, 2017
@ramya-rao-a ramya-rao-a force-pushed the master branch 3 times, most recently from 89e20b7 to 3d8a1f0 Compare November 4, 2017 19:44
Copy link
Copy Markdown
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndrewnee Nice work!
Thanks for your patience, work got real busy this last month and I wasnt able to devote as much time as I'd have liked for reviewing PRs.

I have added 2 comments, 1 is a simple refactor, the other might need some work.

Also, can you rebase or merge from the master branch? There have been quite some changes there.

Thanks!

let editor = vscode.window.activeTextEditor;
let documentUri = editor ? editor.document.uri : null;
let goConfig = vscode.workspace.getConfiguration('go', documentUri);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move all this logic inside lintCurrentPackage function. This is to be consistent with all the other commands and to keep the goMain.ts file clear
Same for lintWorkspace function

src/goMain.ts Outdated
let goConfig = vscode.workspace.getConfiguration('go', documentUri);

lintCurrentPackage(documentUri, goConfig)
.then(handleDiagnosticErrors(editor ? editor.document : null))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling handleDiagnosticErrors clears any existing build and vet errors. It should only update the warnings.

- Cleared goMain.ts, moved logic to lintCurrentPackage and lintWorkspace in goLint.ts
- Moved function handleDiagnosticErrors from goMain.ts to util.ts
- Fixed tests
@ndrewnee
Copy link
Copy Markdown
Contributor Author

ndrewnee commented Nov 8, 2017

@ramya-rao-a No problem) I merged master and made some changes, you can view it. Thanks for your review)

@ramya-rao-a
Copy link
Copy Markdown
Contributor

The diagnostics from build/lint/vet on save features were not showing up, fixed with 99f0957

The linting result from the command was removing the build errors from before, fixed with ef737c9

@ramya-rao-a ramya-rao-a merged commit 3c85b48 into microsoft:master Nov 9, 2017
@ramya-rao-a
Copy link
Copy Markdown
Contributor

Merged, thanks @ndrewnee!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants