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

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

Merged
merged 6 commits into from
Nov 9, 2017
Merged

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

merged 6 commits into from
Nov 9, 2017

Conversation

ndrewnee
Copy link
Contributor

@ndrewnee ndrewnee commented Oct 1, 2017

Fixes #1041

@msftclas
Copy link

msftclas commented Oct 1, 2017

CLA assistant check
All CLA requirements met.

@ndrewnee ndrewnee closed this Oct 11, 2017
@ndrewnee
Copy link
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
Copy link
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!

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

Copy link
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
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
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
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
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