Skip to content

Commit

Permalink
Fix links with double underscores (#121)
Browse files Browse the repository at this point in the history
* bump dev  dependencies

* add 2 files of samples

* 1.1.46

* fix links with `__`

* changelog

* update changelog
  • Loading branch information
MishaKav committed Mar 3, 2023
1 parent e2c4b20 commit be8d9a4
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 59 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog of the Pytest Coverage Comment

## [Pytest Coverage Comment 1.1.46](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.46)

**Release Date:** 2023-03-03

#### Changes

- Fix broken links that include double underscores like `__init__.py`
- Bump dev dependencies

## [Pytest Coverage Comment 1.1.45](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.45)

**Release Date:** 2023-02-04
Expand Down
14 changes: 14 additions & 0 deletions data/pytest-coverage_10.txt
@@ -0,0 +1,14 @@
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.3, py-1.11.0, pluggy-0.13.1

---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name Stmts Miss Cover Missing
----------------------------------------------------------------------------------------------
common/id.py 58 1 98% 18
common/image_sample/db.py 96 46 52% 29, 33, 45, 56-58, 62-92, 96-114, 135-144, 151-153
common/mapper.py 117 2 98% 135-136
common/save.py 79 3 96% 73-75
----------------------------------------------------------------------------------------------
TOTAL 1344 186 86%

15 files skipped due to complete coverage.
28 changes: 28 additions & 0 deletions data/pytest-coverage_11.txt
@@ -0,0 +1,28 @@
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.3, py-1.11.0, pluggy-0.13.1

---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
------------------------------------------------------------------------------------------------------------
common/id_generator.py 58 1 12 1 97% 18
common/image_vulnerabilities/db.py 96 46 22 5 52% 26->36, 29, 33, 45, 56-58, 62-92, 96-114, 135-144, 151-153
common/response_mapper.py 117 2 46 4 96% 127->126, 130->exit, 131->exit, 135-136, 144->146
common/save_vulnerabs.py 79 3 22 0 97% 73-75
common/vulnerabs_db.py 156 21 34 3 87% 133->141, 151-152, 157-159, 178-180, 199-205, 212-214, 234-236, 273-275
deactivation/deactivation.py 20 5 2 1 73% 18-19, 22-24
deactivation/vulnerabilities_deactivation_handler.py 45 2 4 0 96% 62-63
evaluation/evaluation.py 20 5 2 1 73% 18-19, 22-24
evaluation/evaluation_handler_base.py 22 3 0 0 86% 13, 17, 29
evaluation/exploits_evaluation_handler.py 38 4 12 3 86% 27, 30, 32->35, 46-47
image_save_vulnerabs/image_save_vulnerabs.py 71 17 18 5 69% 59-61, 68, 78-91, 99, 103, 107
image_vulnerabilities/image_vulnerabilities.py 57 9 16 3 81% 41, 56-61, 77, 84
malware_analysis/malware_analysis.py 101 34 26 5 61% 39, 72-106, 134->155, 137, 149-153
risk_rating_refresh_util/risk_rating_refresh_util.py 61 23 12 0 58% 25-54, 88-90
sast_evaluator/sast_evaluator.py 99 0 14 1 99% 35->43
sast_evaluator/sast_rules_data_mapper.py 105 0 18 1 99% 117->119
scan_completed/scan_completed.py 82 3 20 0 97% 57-59
vulnerabilities/vulnerabilities.py 87 8 24 2 91% 76, 94-96, 151-154
------------------------------------------------------------------------------------------------------------
TOTAL 1344 186 306 35 85%

13 files skipped due to complete coverage.
5 changes: 2 additions & 3 deletions dist/index.js
Expand Up @@ -17251,8 +17251,7 @@ const toRow = (item, indent = false, options) => {
const missing = toMissingTd(item, options);
const lastTd = options.hasMissing ? `<td>${missing}</td>` : '';

// prettier-ignore
return `<tr><td>${name.replace(/__/g, '\\_\\_')}</td><td>${stmts}</td><td>${miss}</td><td>${cover}</td>${lastTd}</tr>`;
return `<tr><td>${name}</td><td>${stmts}</td><td>${miss}</td><td>${cover}</td>${lastTd}</tr>`;
};

// make summary row - tr
Expand All @@ -17271,7 +17270,7 @@ const toFileNameTd = (item, indent = false, options) => {
const last = parts[parts.length - 1];
const space = indent ? '&nbsp; &nbsp;' : '';

return `${space}<a href="${href}">${last}</a>`;
return `${space}<a href="${href}">${last.replace(/__/g, '\\_\\_')}</a>`;
};

// make folder row - tr
Expand Down
117 changes: 67 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "pytest-coverage-comment",
"version": "1.1.45",
"version": "1.1.46",
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
"author": "Misha Kav",
"license": "MIT",
Expand Down Expand Up @@ -33,8 +33,8 @@
},
"devDependencies": {
"@vercel/ncc": "^0.36.1",
"eslint": "^8.33.0",
"prettier": "^2.8.3"
"eslint": "^8.35.0",
"prettier": "^2.8.4"
},
"prettier": {
"semi": true,
Expand Down
5 changes: 2 additions & 3 deletions src/parse.js
Expand Up @@ -277,8 +277,7 @@ const toRow = (item, indent = false, options) => {
const missing = toMissingTd(item, options);
const lastTd = options.hasMissing ? `<td>${missing}</td>` : '';

// prettier-ignore
return `<tr><td>${name.replace(/__/g, '\\_\\_')}</td><td>${stmts}</td><td>${miss}</td><td>${cover}</td>${lastTd}</tr>`;
return `<tr><td>${name}</td><td>${stmts}</td><td>${miss}</td><td>${cover}</td>${lastTd}</tr>`;
};

// make summary row - tr
Expand All @@ -297,7 +296,7 @@ const toFileNameTd = (item, indent = false, options) => {
const last = parts[parts.length - 1];
const space = indent ? '&nbsp; &nbsp;' : '';

return `${space}<a href="${href}">${last}</a>`;
return `${space}<a href="${href}">${last.replace(/__/g, '\\_\\_')}</a>`;
};

// make folder row - tr
Expand Down

0 comments on commit be8d9a4

Please sign in to comment.