sublimelinter / sublimelinter-gotype Goto Github PK
View Code? Open in Web Editor NEWThis linter plugin for SublimeLinter provides an interface to gotype.
License: MIT License
This linter plugin for SublimeLinter provides an interface to gotype.
License: MIT License
Really love this plugin, but it has one fatal flaw which is that when passing gotype a single filename, it will ignore other files in the same package, so you get undeclared name errors constantly.
It seems to me that you could locate the directory the file is in, run gotype -e <dir>
, then filter the errors that it dumps out to only that file.
I can see errors in regular go files but I cannot see errors in my _test.go files in the same package. I tried to use argument "-t" but I get an error:
Traceback (most recent call last):
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/lint/queue.py", line 65, in loop
self.lint(view_id, timestamp)
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/lint/queue.py", line 111, in lint
self.callback(view_id, timestamp)
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/sublimelinter.py", line 120, in lint
Linter.lint_view(view, filename, code, hit_time, callback)
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/lint/linter.py", line 929, in lint_view
linter.lint(hit_time)
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/lint/linter.py", line 1410, in lint
for match, line, col, error, warning, message, near in self.find_errors(output):
File "/Users/nicholasphillips/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/lint/linter.py", line 1749, in find_errors
yield self.split_match(self.regex.match(line.rstrip()))
File "linter in /Users/nicholasphillips/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter-contrib-gotype.sublime-package", line 43, in split_match
AttributeError: 'NoneType' object has no attribute 'group'
With a fresh install of GoSublime, following this guide: https://github.com/abourget/getting-started-with-golang/blob/master/Setting_up_Sublime_properly.md
it appears that gotype
blocks linting from even golint
and govet
.
Not sure how to debug and get things working again.. so will be suggesting to disable gotype
.
I'd like to migrate this to https://github.com/SublimeLinter Org. I'm not using it and would like to look for another maintainer.
@groteworld can we do this?
Say you have a project that is organized as follows:
$GOPATH/
+src/
+name/
+a/
+a.go
+b/
+b.go
It is perfectly legal for b.go
to have a line such as import name/a
. However, in the current setup, gotype
fails to do the import (presumably because of the way files are copied to the temp directory). As a result, I get a ton of lint errors on everything that uses that package, even though the code will run just fine.
I am currently forced to run gotype
with the following ignore_match
settings:
"could not import [a-z/]* \\(can't find import: [a-z/]*\\)",
"undeclared name: [a-zA-Z_]*"
I was wondering if there is something I am doing wrong, or if this is a bug in the plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.