google / vim-coverage Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
I wrote a plugin for Codecov JSON format (see https://github.com/AlexHaxe/vim-codecovjson)
and it works fine until I recompile my project (https://github.com/HaxeCheckstyle/haxe-checkstyle), generating new coverage data. Unchanged files still work, but the files that have changed show an error message:
Error detected while processing function coverage#Toggle..<SNR>216_CoverageToggle..<SNR>216_CoverageShow..<SNR>216_RenderFromCache..<SNR>216_ColorSigns:
line 2:
E158: Invalid buffer name: src/checkstyle/token/TokenTreeBuilder.hx
Add a coverage provider to support reading ruby rcov coverage results into vim.
After doing :CoverageShow
, could you have vim watch whatever .coverage file it loaded results from and immediately notice and reload results if that changes? For example, if you run nosetests --with-coverage
outside of vim and that generates new coverage results for the current file, could the plugin immediately discard the stale results and show the fresh ones?
Note we already have #27 to have a manual way to reload coverage, like :CoverageShow!
.
We should define a command like :CoverageInfo
or :CoverageDebug
to show info to help users troubleshoot, e.g.: is coverage visible, what provider was used, what providers are available, are coverage stats against the current version or an older version…
For some projects and coverage tools, coverage is expensive to evaluate and it's useful to be able to show coverage data from an older snapshot.
There's some complexity to getting this kind of snapshotted coverage functionality to work well since line numbers won't match up if there have been significant modifications to the file since, and there may need to be a way to show a diff of the modifications.
Are there any coverage providers already?
Would be nice to have list somewhere (README or wiki)?!
Add a coverage provider to support reading python coverage results from "nosetests --with-coverage" into vim.
For working on bazel projects, it would be great to have a simple way to show coverage results generated from bazel coverage
(see https://docs.bazel.build/versions/master/command-line-reference.html#coverage and https://blog.bazel.build/2018/10/29/bazel-0.19.0.html#code-coverage).
A gcov coverage provider (#6) gets us part of the way there, but the wiring gets a little complicated for how to easily…
bazel coverage
commandError detected while processing function coverage#Show[9]..function coverage#Show[5]..<SNR>75_CoverageShow[9]..coverage#ShowCoverage[45]..4[13]..maktaba#python#Eval:
line 6:
Traceback (most recent call last):
File "/usr/lib64/python3.7/site-packages/coverage/data.py", line 293, in read_file
self.read_fileobj(f)
File "/usr/lib64/python3.7/site-packages/coverage/data.py", line 271, in read_fileobj
data = self._read_raw_data(file_obj)
File "/usr/lib64/python3.7/site-packages/coverage/data.py", line 311, in _read_raw_data
go_away = file_obj.read(len(cls._GO_AWAY))
File "/usr/lib64/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 99: invalid continuation byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/fedora/.vim/plugged/vim-coverage/python/vim_coverage.py", line 33, in GetCoveragePyLines
cov.load()
File "/usr/lib64/python3.7/site-packages/coverage/control.py", line 677, in load
self.data_files.read(self.data)
File "/usr/lib64/python3.7/site-packages/coverage/data.py", line 653, in read
data.read_file(self.filename)
File "/usr/lib64/python3.7/site-packages/coverage/data.py", line 297, in read_file
filename, exc.__class__.__name__, exc,
coverage.misc.CoverageException: Couldn't read data from '/home/fedora/Desktop/GIT/tinydb/.coverage': UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 99: invalid continu
ation byte
E858: Eval did not return a valid python object
lib version
attrs==20.1.0
coverage==5.2.1
importlib-metadata==1.7.0
iniconfig==1.0.1
more-itertools==8.4.0
packaging==20.4
pluggy==0.13.1
py==1.9.0
pyparsing==2.4.7
pytest==6.0.1
pytest-cov==2.10.1
six==1.15.0
toml==0.10.1
zipp==3.1.0
Feature request: This plugin should define commands and keymappings for jumping to the next uncovered and/or partially-covered line so that navigating a coverage-annotated file becomes easier. The vim-signjump plugin is related prior art, but I believe that combining it with vim-coverage would just lead to jumping between each & every line of code.
It would be nice to be able to render coverage from Cobertura files.
I have a simple implementation that could be built on for this.
Add a coverage provider to support reading gcov coverage results into vim.
We should document an autocmd a user can define to show coverage on certain paths as soon as they're opened, without seeing an error or warning about missing coverage (particularly in the async case). Currently there's no obvious way to get that behavior reliably.
The coverage plugin will need to document some clear contract for what .GetCoverage
should throw/return and what .GetCoverageAsync
should do to signal coverage was not found, and use that to surface error information to the user consistently.
It looks like diff_path
is not being added to the data anywhere!? (
vim-coverage/autoload/coverage.vim
Line 130 in 88d0204
And (although mentioned in
vim-coverage/autoload/coverage.vim
Lines 184 to 185 in 88d0204
Travis CI runs like https://travis-ci.org/google/vim-coverage/builds/571731678 are failing with errors from vim like:
E319: Sorry, the command is not available in this version: python <<EOF
It seems to be building with Debian's latest vim package that enables python3 and doesn't have python2 support, so the test setup needs to be updated to be compatible with python3.
It does not seem to be possible currently to update already loaded coverage information currently, is it?
Maybe related to #19 ?!
I've thought about adding bang support to CoverageShow
, so that CoverageShow!
would refresh the cache.
What do you think?
I'm having trouble getting this plugin to work with a Python project on my MacBook, and I'm wondering if it may be due to it requiring a version of Vim that was built with Python support, which the pre-supplied Vim on macOS lacks. Is this the case? The documentation doesn't mention that. If it is the case, would it be reasonable to add support for non-integrated Pythons?
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.