Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metalinter problems #1640

Merged
merged 5 commits into from
Jan 13, 2018
Merged

Fix metalinter problems #1640

merged 5 commits into from
Jan 13, 2018

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Jan 8, 2018

Make sure linter errors for the file being saved are shown in vim74 and
nvim.

Make sure only linter errors for the file being saved are shown in vim8.
Previously, all linter errors for all files in the current file's
directory were being shown.

Make sure gometalinter is run on the given directories when arguments
are given to :GoMetaLinter.

Fixes #1623

@codecov-io
Copy link

codecov-io commented Jan 8, 2018

Codecov Report

Merging #1640 into master will increase coverage by 2.71%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1640      +/-   ##
==========================================
+ Coverage    19.3%   22.02%   +2.71%     
==========================================
  Files          53       53              
  Lines        4159     4178      +19     
==========================================
+ Hits          803      920     +117     
+ Misses       3356     3258      -98
Flag Coverage Δ
#nvim 16.85% <88.88%> (+2.32%) ⬆️
#vim74 19.33% <88.88%> (+1.64%) ⬆️
#vim80 20.89% <81.48%> (+2.42%) ⬆️
Impacted Files Coverage Δ
autoload/go/lint.vim 54.23% <100%> (+54.23%) ⬆️
autoload/gotest.vim 95.71% <89.47%> (-2.33%) ⬇️
autoload/go/util.vim 61.02% <0%> (+0.51%) ⬆️
autoload/go/list.vim 66.66% <0%> (+3.99%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80730c7...7702f5c. Read the comment docs.

@arp242
Copy link
Contributor

arp242 commented Jan 10, 2018

I think this is more or less the same as #1621 ?

@bhcleek
Copy link
Collaborator Author

bhcleek commented Jan 10, 2018

It's similar, for sure. But it also adds tests and fixes another issue that was wrong with :GoMetaLinter: when given a path (e.g. :GoMetaLinter ./path/to/a/package), the argument wasn't being used.

I hadn't noticed #1621; sorry for the duplication of effort.

@bhcleek bhcleek force-pushed the fix-metalinter branch 2 times, most recently from 8cf156f to 6d18a1a Compare January 10, 2018 19:54
@bhcleek
Copy link
Collaborator Author

bhcleek commented Jan 10, 2018

@Carpetsmoker I ran these tests against #1621, and found that #1621 still doesn't handle the relative pathing correctly. I'd prefer not to push over someone else's branch on their repo, so I rebased #1621 onto master, then rebased this branch on top of that, splitting my original two commits up into three, so that the last two commits each address one fix instead of combining them.

@fatih
Copy link
Owner

fatih commented Jan 13, 2018

@bhcleek after I merged your latest change this needs to be rebased again.

Tom Barlow and others added 5 commits January 13, 2018 01:00
When go#lint#Gometa is triggered by autosave, we attempt to only show
lint warnings and errors that are applicable for the active buffer. This
is done by passing the path to the file represented by the active buffer
to gometalinter's `--include` option.

The existing behaviour expands the absolute path, whereas gometalinter
outputs paths that are relative to the current working directory.

This change modifies the variable used for matching so that we also use
the current working directory for matching against lint errors/warnings.

Signed-off-by: Tom Barlow <[email protected]>
@bhcleek
Copy link
Collaborator Author

bhcleek commented Jan 13, 2018

@fatih I rebased it.

@fatih fatih merged commit aa9ee00 into fatih:master Jan 13, 2018
@fatih
Copy link
Owner

fatih commented Jan 13, 2018

Thanks @tombee @bhcleek @Carpetsmoker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants