Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruanyl/coc-coverage
coc.nvim extension to show code coverage
https://github.com/ruanyl/coc-coverage
coverage neovim vim
Last synced: 2 months ago
JSON representation
coc.nvim extension to show code coverage
- Host: GitHub
- URL: https://github.com/ruanyl/coc-coverage
- Owner: ruanyl
- License: mit
- Created: 2021-02-17T22:23:02.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T11:18:13.000Z (over 3 years ago)
- Last Synced: 2024-09-29T01:43:02.704Z (3 months ago)
- Topics: coverage, neovim, vim
- Language: TypeScript
- Homepage:
- Size: 97.7 KB
- Stars: 11
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# coc-coverage
coc.nvim extension to show test coverage sign
## Install
`:CocInstall coc-coverage`
The extension supports istanbul `json reporter` format:
- [istanbul](https://github.com/gotwarlost/istanbul)
- [nyc](https://github.com/istanbuljs/nyc)
- [karma-coverage](https://github.com/karma-runner/karma-coverage)
- [jest](https://github.com/facebook/jest)By default, this extension read coverage from `coverage/coverage-final.json`
## Configuration
`coverage.enabled` enable coc-coverage extension, default: `true``coverage.uncoveredSign.text` the sign to display on uncovered lines, default `▣`
`coverage.uncoveredSign.hlGroup` uncovered sign hightlight group, default `UncoveredLine`
`coverage.jsonReportPath` path to coverage json report, default `/coverage/coverage-final.json`
## Customized sign color
The default hightlight name is `UncoveredLine`, make sure this is set before loading coc.nvim
```
hi UncoveredLine guifg=#ffaa00 guibg=#ffaa00
```## Configure Status Line
```
function! LightlineCocCoverageStatus() abort
let status = get(g:, 'coc_coverage_lines_pct', '')
if empty(status)
return ''
endifreturn '☂ ' . status . '% Lines Covered'
endfunctionlet g:lightline = {
\ 'active': {
\ 'left': [
\ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename' ]
\ ],
\ 'right':[
\ [ 'coccoverage', 'lineinfo', 'percent', 'cocstatus' ],
\ [ 'cocapollo' ]
\ ],
\ },
\ 'component_function': {
\ 'coccoverage': 'LightlineCocCoverageStatus'
\ }
\ }
```## License
MIT
---
> This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)