{"id":15287831,"url":"https://github.com/vimjas/covimerage","last_synced_at":"2025-09-20T21:39:27.577Z","repository":{"id":47133943,"uuid":"103978793","full_name":"Vimjas/covimerage","owner":"Vimjas","description":"Generate coverage information for Vim scripts.","archived":false,"fork":false,"pushed_at":"2021-09-12T20:44:39.000Z","size":267,"stargazers_count":46,"open_issues_count":16,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T06:06:46.601Z","etag":null,"topics":["coverage","neovim","testing","vim","vim-scripts"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vimjas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-18T18:52:49.000Z","updated_at":"2024-11-27T08:56:01.000Z","dependencies_parsed_at":"2022-09-13T19:01:05.704Z","dependency_job_id":null,"html_url":"https://github.com/Vimjas/covimerage","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fcovimerage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fcovimerage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fcovimerage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fcovimerage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vimjas","download_url":"https://codeload.github.com/Vimjas/covimerage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670435,"owners_count":21142904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","neovim","testing","vim","vim-scripts"],"created_at":"2024-09-30T15:38:36.864Z","updated_at":"2025-09-20T21:39:22.506Z","avatar_url":"https://github.com/Vimjas.png","language":"Python","readme":"# covimerage\n\nGenerates code coverage information for Vim scripts.\n\nIt parses the output from Vim's `:profile` command, and generates data\ncompatible with [Coverage.py](http://coverage.readthedocs.io/).\n\n[![Build Status](https://circleci.com/gh/Vimjas/covimerage/tree/master.svg?style=shield)](https://circleci.com/gh/Vimjas/covimerage)\n[![codecov](https://codecov.io/gh/Vimjas/covimerage/branch/master/graph/badge.svg)](https://codecov.io/gh/Vimjas/covimerage/branch/master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/548eb25f726646fbbe660dc9fb6d392a)](https://www.codacy.com/app/blueyed/covimerage)\n\n## Installation\n\nYou can install covimerage using pip:\n\n```sh\npip install covimerage\n```\n\n## Simple usage\n\nYou can use `covimerage run` to wrap the call to Neovim/Vim with necessary\nboilerplate:\n\n```sh\ncovimerage run vim -Nu test/vimrc -c 'Vader! test/**'\n```\n\nThis will write the file `.coverage_covimerage` by default (use `--data-file`\nto configure it), which is compatible with Coverage.py.\nA report is automatically generated (on stdout).\n\nYou can then call `covimerage xml` to create a `coverage.xml` file\n(Cobertura-compatible), which tools like [Codecov](https://codecov.io/)'s\n`codecov` tool can consume, e.g. via `codecov -f coverage.xml`.\n\n## Manual/advanced usage\n\n### 1. Generate profile information for your Vim script(s)\n\nYou have to basically add the following to your tests vimrc:\n\n```vim\nprofile start /tmp/vim-profile.txt\nprofile! file ./*\n```\n\nThis makes Neovim/Vim then write a file with profiling information.\n\n### 2. Call covimerage on the output file(s)\n\n```sh\ncovimerage write_coverage /tmp/vim-profile.txt\n```\n\nThis will create a file `.coverage_covimerage` (the default for `--data-file`),\nwith entries marked for processing by a\n[Coverage.py](http://coverage.readthedocs.io/) plugin (provided by\ncovimerage)).\n\n### 3. Include the covimerage plugin in .coveragerc\n\nWhen using `coverage` on the generated output (data file), you need to add\nthe `covimerage` plugin to the `.coveragerc` file (which Coverage.py uses).\nThis is basically all the `.coveragerc` you will need, but you could use\nother settings here (for Coverage.py), e.g. to omit some files:\n\n```\n[run]\nplugins = covimerage\ndata_file = .coverage_covimerage\n```\n\n### 4. Create the report(s)\n\nYou can now call e.g. `coverage report -m`, and you should be able to use\ncoverage reporting platforms like \u003chttps://codecov.io/\u003e or\n\u003chttps://coveralls.io\u003e, which are basically using `coverage xml`.\n\n## Reference implementation\n\n- [Neomake](https://github.com/neomake/neomake) is the first adopter of this.\n  It has an advanced test setup (including Docker based builds), and looking at\n  tis setup could be helpful when setting up covimerage for your\n  plugin/project.\n\n  - [Neomake's coverage report on codecov.io](https://codecov.io/gh/neomake/neomake/tree/master)\n  - [PR/change to integrate it in\n    Neomake](https://github.com/neomake/neomake/pull/1600) (Neomake's test\n    setup is rather advanced, so do not let that scare you!)\n\n## Caveats\n\nCoverage information for a function may get wiped if the function is re-defined\nafter testing it. This is a known limitation that does not depend on the\nimplementation of covimerage, but on the vim profiler itself, since profiling\ndata for a function, used to extract coverage data, is reset when the function\nis re-defined, even if the definition is identical.\n\nThis can be an issue if the source files being checked for coverage are\nreloaded with `runtime` between tests for some reasons, e.g. when mocking some\nfunction. To prevent coverage information from being lost, one solution is to\nwrite such tests in a different suite that is run separately, and combine the\ncoverage results with `covimerage run --append`.\n\n## Links\n\n- Discussion in Coverage.py's issue tracker:\n  [coverage issue 607](https://bitbucket.org/ned/coveragepy/issues/607/)\n\n## TODO\n\n- Line hit counts: known to covimerage, but not supported by Coverage.py\n  (\u003chttps://bitbucket.org/ned/coveragepy/issues/607/#comment-40048034\u003e).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimjas%2Fcovimerage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimjas%2Fcovimerage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimjas%2Fcovimerage/lists"}