alfredodeza / coveragepy.vim Goto Github PK
View Code? Open in Web Editor NEWA Vim plugin to facilitate integration with Coverage.py
A Vim plugin to facilitate integration with Coverage.py
It would be nice, for integration with other gutter symbols and a less-strong desire to only use the current presentation for brief glances (ze goggles, zey do nothing!), if lines not covered by tests be annotated with a warning-level "TT" compared to the current, high-contrast background.
Thanks!
In our environment we have our test cases in a sub-folder named _test. When running
coverage inside the _test folder coveragepy cant open the .coverage file maybe because it contains long paths to the files in the parent folder.
Error detected while processing function 23_Proxy..23_HighlightMissing:
line 13:
E63: Invalid use of _
Environment:
Hello! Iām trying out this plugin. I work with tabs and panes a lot and happened to have the plugin file, a Python module and its tests all open in three panes. When running Coveragepy report in the module or tests file pane, the first one got the gutter decoration.
If you toggle off a session currently the buffer is removed but the signs are left behind.
It would be nice if there is an option or it defaults to removing the signs when closing the buffer
Highlighting fails in windows because the file system paths contain backslashes.
When you match the path from g:coveragepy_session_map
against the absolute path of the current buffer, it will always return 0 because of the way backslashes behave in regex patterns.
To fix this, I changed the pattern like this: let path_pattern = '\M' . substitute(path, '\\', '\\\\', 'g')
Doubling the backslashes will make the pattern work as expected.
I only tested on Windows, but I don't see any reason why it wouldn't work on *nix systems as well.
When both /usr/bin/python-coverage and /usr/bin/python3-coverage are installed, coveragepy.vim uses the first one even if the coverage report has been created from Python 3.
When only /usr/bin/python3-coverage is installed, coveragepy.vim does not use it.
Using the wrong version leads to misleading ouput showing some files as 100% covered.
Some hints, warnings or autodetection would be nice. Thanks!
Calling ":Coveragepy report" from vim yields
Error detected while processing function <SNR>78_Proxy..<SNR>78_CoveragepyReport..<SNR>78_ReportParse..<SNR>78_LineNumberParse:
line 10:
E727: Start past end
E714: List required
There is a .coverage
in the current directory.
I run coverage
coverage run setup.py test
in vim, open coveragepy
:Coveragepy show
ok. Then I modifify the code and run coverage again (in other terminal, without close vim)
coverage run setup.py test
and hide and show Coveragepy
:Coveragepy show
:Coveragepy show
but, the coverages lines don't are updated.
I'm using:
I'm trying to get coveragepy.vim to work, but I can't seem to get the coverage portion to see uncovered lines.
Assume I clone this ciscoconfparse2 repo (ref git hash 2feeff184d4dee6a2c3b10ff756e0e1151f2ffd2
) and then edit ciscoconfparse2/models_cisco.py. I currently see Coveragepy ==> 100% covered
when I run :Coveragepy show
, but that's obviously not true. There are loads of uncovered methods in that file.
How do I debug / fix what is wrong?
Sometimes, all I want to see is lines that are not covered and not interested in the whole report.
When I try to run any of the commands, I see a ton of echos about "Current buffer" and file. While a report eventually loads, the signs don't seem to function properly
Current buffer shows as an absolute path without .py on the end
file shows as a relative path with .py on the end
I traced this down to this function in the code: https://github.com/alfredodeza/coveragepy.vim/blob/master/ftplugin/python/coveragepy.vim#L106
If I change that [1]
to a [0]
(essentially negating the stripping of the .py
I believe,) I see no echos and everything appears to work.
Hello, I'm trying this plugin it does what it says, and that's great!, however I'm having a weird (and annoying) behaviour when running :Coveragepy report
the report opens up fitting all the available height in vim and my actual code window is reduced to only one line height, let me show you what I mean:
Is there some option to set to fix the report window height?
Thanks
Installed using vundle, a very strange error, but I don't really know how to interpret it at all - I can do :execute
in the vim command line so I cant see why it would complain about this... any hints?
More context - my .coverage file is in the root of my project, and I am using pytest-cov to generate it.
Version comes up as 1.1dev
:Coveragepy show
Error detected while processing function <SNR>98_Proxy[4]..<SNR>98_ToggleSigns[3]..<SNR>98_ClearSigns:
line 1:
E117: Unknown function: execute
E116: Invalid arguments for function split(execute('sign place file=' . bufname('%')), '\n')
E15: Invalid expression: split(execute('sign place file=' . bufname('%')), '\n')
Nice plugin!
I've noticed however that it would unplace all signs with :Coveragepy unshow
(
coveragepy.vim/ftplugin/python/coveragepy.vim
Lines 85 to 87 in 599f695
I came across https://github.com/google/vim-coverage.
Have you seen it?
Would you consider acting as a provider for it (additionally)?
https://github.com/google/vim-coverage#installing-and-configuring-coverage-providers
After I updated coverage to 4.0.3, all files are100% covered in the plugin, even the fact is they are not 100% covered.
Do I need to add something to .vimrc? This is in my .vim/ftplugin/python directory.
Hi,
I get the following error when using this plugin
Error detected while processing function <SNR>128_Proxy..<SNR>128_CoveragepyReport..<SNR>128_ReportParse..<SNR>128_LineNumberParse:
line 10:
E727: Start past end
E714: List required
Error detected while processing function <SNR>128_Proxy..<SNR>128_CoveragepyReport..<SNR>128_ReportParse:
line 9:
E706: Variable type mismatch for: all_line_nos
Hi,
I have the latest version of the plugin installed (with vundle) but when I try to run it, I get:
Error detected while processing function <SNR>93_Proxy[10]..<SNR>93_HighlightMissing:
line 8:
E684: list index out of range: 0
What could be the issue, I can't make heads or tails of the error message.
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.