diff --git a/.travis.yml b/.travis.yml index de3ab752..45175b76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,6 @@ install: - go get -u golang.org/x/tools/cmd/gorename - go get -u github.com/sqs/goreturns - go get -u github.com/mdempsky/gocode - - go get -u github.com/alecthomas/gometalinter - go get -u github.com/zmb3/gogetdoc - go get -u github.com/zmb3/goaddimport - go get -u github.com/rogpeppe/godef diff --git a/appveyor.yml b/appveyor.yml index 840c3345..76cd5e26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,6 @@ install: - go get -u golang.org/x/tools/cmd/gorename - go get -u github.com/sqs/goreturns - go get -u github.com/mdempsky/gocode - - go get -u github.com/alecthomas/gometalinter - go get -u github.com/zmb3/gogetdoc - go get -u github.com/zmb3/goaddimport - go get -u github.com/rogpeppe/godef diff --git a/lib/lint/linter.js b/lib/lint/linter.js index fb948db1..4d9739f2 100644 --- a/lib/lint/linter.js +++ b/lib/lint/linter.js @@ -187,69 +187,6 @@ type Tool = { } const TOOLS: { [string]: Tool } = { - gometalinter: { - prepareArgs(configuredArgs: string[]): string[] { - let args = [...configuredArgs] - if (!args.length) { - args = [ - '--vendor', - '--disable-all', - '--enable=vet', - '--enable=vetshadow', - '--enable=golint', - '--enable=ineffassign', - '--enable=goconst', - '--tests', - '--json', - '.' - ] - } - if (!args.includes('--json')) { - args.unshift('--json') - } - return args - }, - mapMessages( - stdout: string, - editor: TextEditor, - cwd: string - ): Array { - let messages = [] - try { - messages = JSON.parse(stdout) - } catch (e) { - console.log(e) // eslint-disable-line no-console - } - if (!messages || messages.length < 1) { - return [] - } - - const results: Array = [] - - for (const message of messages) { - let range - if (message.col && message.col >= 0) { - range = new Range( - [message.line - 1, message.col - 1], - [message.line - 1, 1000] - ) - } else { - range = new Range([message.line - 1, 0], [message.line - 1, 1000]) - } - results.push({ - linterName: message.linter, - severity: message.severity.toLowerCase(), - location: { - file: path.join(cwd, message.path), - position: range - }, - excerpt: message.message + ' (' + message.linter + ')' - }) - } - - return results - } - }, revive: { prepareArgs(configuredArgs: string[]): string[] { let args: string[] = ['--formatter=json'] diff --git a/lib/package-manager.js b/lib/package-manager.js index 451b4ac3..30877a8d 100644 --- a/lib/package-manager.js +++ b/lib/package-manager.js @@ -17,8 +17,7 @@ const oldPackages = [ 'go-hyperclick', 'navigator-go', 'go-get', - 'go-config', - 'gometalinter-linter' + 'go-config' ] const bundledPackages = new Map([ @@ -38,7 +37,6 @@ const goTools = new Map([ ['gorename', 'golang.org/x/tools/cmd/gorename'], ['goreturns', 'github.com/sqs/goreturns'], ['gocode', 'github.com/stamblerre/gocode'], - ['gometalinter', 'github.com/alecthomas/gometalinter'], ['revive', 'github.com/mgechev/revive'], ['golangci-lint', 'github.com/golangci/golangci-lint/cmd/golangci-lint'], ['gogetdoc', 'github.com/zmb3/gogetdoc'], @@ -250,51 +248,7 @@ class PackageManager { } for (const [key, value] of goTools) { const packagePath = value - if (key === 'gometalinter') { - this.subscriptions.add( - this.goget.register(packagePath, async (outcome, packs) => { - if (!packs.includes(packagePath)) { - return - } - const cmd = await this.goconfig.locator.findTool('gometalinter') - if (!cmd) { - return - } - const notification = atom.notifications.addInfo('gometalinter', { - dismissable: true, - icon: 'cloud-download', - description: 'Running `gometalinter --install` to install tools.' - }) - const opt = this.goconfig.executor.getOptions('project') - const r = await this.goconfig.executor.exec(cmd, ['--install'], opt) - notification.dismiss() - const stdout = - r.stdout instanceof Buffer ? r.stdout.toString() : r.stdout - const stderr = - r.stderr instanceof Buffer ? r.stderr.toString() : r.stderr - const detail = stdout + os.EOL + stderr - - if (r.exitcode !== 0) { - atom.notifications.addWarning('gometalinter', { - dismissable: true, - icon: 'cloud-download', - detail: detail.trim() - }) - return r - } - if (stderr && stderr.trim() !== '') { - console.log('go-plus: (stderr) ' + stderr) // eslint-disable-line no-console - } - atom.notifications.addSuccess('gometalinter', { - dismissable: true, - icon: 'cloud-download', - detail: detail.trim(), - description: 'The tools were installed.' - }) - return r - }) - ) - } else if (key === 'gocode') { + if (key === 'gocode') { this.subscriptions.add( this.goget.register(packagePath, async (outcome, packs) => { if (!packs.includes(packagePath)) { diff --git a/package.json b/package.json index cd1ffb66..8b33e7aa 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "goreturns", "lint", "vet", - "gometalinter", "go-debug", "delve", "hyperclick", @@ -395,11 +394,10 @@ "title": "Linter", "description": "The linter that is used to lint your code", "type": "string", - "default": "gometalinter", + "default": "golangci-lint", "enum": [ - "gometalinter", - "revive", - "golangci-lint" + "golangci-lint", + "revive" ], "order": 1 },