README
codecov-json-to-lcov
Convert Codecov JSON format to lcov format.
Installation
npm install codecov-json-to-lcov
Usage
import toLcov from "codecov-json-to-lcov";
const codecovJSON = require("./fixtures/codecov.json");
toLcov(codecovJSON);
/*
lcov format
*/
Example
Convert codecov json:
{
"coverage": {
"path/to/file.py": [null, 1, 0, null, true, 0, 0, 1, 1],
"path/to/other.py": [null, 0, 1, 1, "1/3", null]
},
"messages": {
"path/to/other.py": {
"1": "custom message for line 1"
}
}
}
to lcov
SF:path/to/file.py
DA:1,1
DA:2,0
DA:3,0
DA:4,1
DA:5,0
DA:6,0
DA:7,1
DA:8,1
LF:8
LH:4
end_of_record
SF:path/to/other.py
DA:1,0
DA:2,1
DA:3,1
DA:4,1
DA:5,0
LF:5
LH:2
end_of_record
Tests
npm test
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT