See cuv/README.rst
meejah / cuvner Goto Github PK
View Code? Open in Web Editor NEWA commanding view of your test-coverage.
License: MIT License
A commanding view of your test-coverage.
License: MIT License
See cuv/README.rst
I don't have a good way to place the text in the histogram from cuv hist
: there doesn't seem to be a good way to "know" how wide text is going to be (or, alternatively, make the origin of the text the right-hand-edge).
Perhaps there are some tricks I can play with the co-ordinate system etc...?
What I want is to figure out how many characters I can fit in the file-names label portion, and then put that amount there but lined up like in cuv graph
so that the slashes from the same directory-level are at the same position.
(txkube) exarkun@baryon:~/Work/LeastAuthority/txkube$ git diff origin/master... | cuv diff -
skip: MANIFEST.in
skip: README.rst
skip: src/txkube/extra-1.5.json
b/src/txkube/__init__.py
"IObject", "IKubernetes", "IKubernetesClient",
"KubernetesError", "UnrecognizedVersion", "UnrecognizedKind",
- "v1", "v1beta1", "iobject_from_raw", "iobject_to_raw",
Traceback (most recent call last):
File "/home/exarkun/Environments/txkube/bin/cuv", line 11, in <module>
sys.exit(cuv())
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/cuv/cli.py", line 315, in diff
diff_color(input_file, ctx.obj)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/cuv/diff.py", line 117, in diff_color
pager.echo(colors.color(u'\u258f', fg='green'), nl=False, color=True)
File "/home/exarkun/Environments/txkube/local/lib/python2.7/site-packages/colors/colors.py", line 109, in color
return '\x1b[{0}m{1}\x1b[0m'.format(_join(*codes), s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u258f' in position 0: ordinal not in range(128)
(txkube) exarkun@baryon:~/Work/LeastAuthority/txkube$
This goes away when I downgrade ansicolors to 1.0.2.
With cuv lessopen
, if I print('...'.encode('utf8')
then less -R
works properly (i.e. shows colours) but if I click.echo('...')
then the colours don't work with less. Don't know why.
..and in Python3 the print() with encode prints out a binary repr of the string, basically.
It seems cuvner doesn't have Python 3 support:
Traceback (most recent call last):
File "./.venv/bin/cuv", line 9, in <module>
load_entry_point('cuvner==0.0.0', 'console_scripts', 'cuv')()
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/click/decorators.py", line 27, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/cuv/cli.py", line 139, in graph
graph_coverage(keyword, cfg)
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/cuv/graph.py", line 97, in graph_coverage
graph += percent_to_bar(float(bad) / float(total))
File "/home/florian/proj/qutebrowser/git/.venv/lib/python3.5/site-packages/cuv/graph.py", line 70, in percent_to_bar
unichr(0x2580 + int(prct / 0.125)), fg='red', bg='green'
NameError: name 'unichr' is not defined
But when running it in a Python2 virtualenv, I can't run it over my Python3 source either:
Coverage in: /home/florian/proj/qutebrowser/git/qutebrowser/
Traceback (most recent call last):
File "./.venv2/bin/cuv", line 9, in <module>
load_entry_point('cuvner==0.0.0', 'console_scripts', 'cuv')()
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/click/decorators.py", line 27, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/cuv/cli.py", line 139, in graph
graph_coverage(keyword, cfg)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/cuv/graph.py", line 76, in graph_coverage
data = create_analysis(cfg.data, fname)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/cuv/analysis.py", line 34, in create_analysis
args = covdata.analysis2(name)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/control.py", line 872, in analysis2
analysis = self._analyze(morf)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/control.py", line 891, in _analyze
return Analysis(self.data, it)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/results.py", line 19, in __init__
self.statements = self.file_reporter.lines()
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/python.py", line 139, in lines
self._statements, self._excluded = self.parser.parse_source()
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/parser.py", line 207, in parse_source
self._raw_parse()
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/parser.py", line 165, in _raw_parse
self.statement_starts.update(self.byte_parser._find_statements())
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/parser.py", line 73, in byte_parser
self._byte_parser = ByteParser(self.text, filename=self.filename)
File "/home/florian/proj/qutebrowser/git/.venv2/lib/python2.7/site-packages/coverage/parser.py", line 342, in __init__
filename, synerr.msg, synerr.lineno
coverage.misc.NotPython: Couldn't parse '/home/florian/proj/qutebrowser/git/qutebrowser/app.py' as Python source: 'invalid syntax' at line 767
It turns out there are two options to the Pygments lexers that must be set to False
or it will silently drop leading whitespace-lines.
Also, since we "do Pygments lexer stuff" in many places, this should be re-factored to some kind of utility method.
The important options are lexer.stripall = False
and lexer.stripnl = False
.
At least cuv diff
doesn't nicely report to the user that there's no .coverage file
There's a bunch of duplicate code in all the "commands" that should be factored out and re-used; this includes all the filtering stuff, matching code, etc. Probably this also wants common command-line options etc.,
If you type cuv <filename>
then you should get the result of cuv lessopen
passed through $PAGER
-- that is, syntax-highlighted, coverage-coloured view of the file.
(Thanks @kneufeld)
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.