From be8d9a47c0ca22975c9cb8b892d268dd9815640f Mon Sep 17 00:00:00 2001 From: Misha Kav Date: Fri, 3 Mar 2023 17:18:17 +0200 Subject: [PATCH] Fix links with double underscores (#121) * bump dev dependencies * add 2 files of samples * 1.1.46 * fix links with `__` * changelog * update changelog --- CHANGELOG.md | 9 +++ data/pytest-coverage_10.txt | 14 +++++ data/pytest-coverage_11.txt | 28 +++++++++ dist/index.js | 5 +- package-lock.json | 117 +++++++++++++++++++++--------------- package.json | 6 +- src/parse.js | 5 +- 7 files changed, 125 insertions(+), 59 deletions(-) create mode 100644 data/pytest-coverage_10.txt create mode 100644 data/pytest-coverage_11.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9b56f..d3c3000 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/data/pytest-coverage_10.txt b/data/pytest-coverage_10.txt new file mode 100644 index 0000000..592ad9c --- /dev/null +++ b/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. diff --git a/data/pytest-coverage_11.txt b/data/pytest-coverage_11.txt new file mode 100644 index 0000000..9652ccf --- /dev/null +++ b/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. diff --git a/dist/index.js b/dist/index.js index 87cb3be..46bb96b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -17251,8 +17251,7 @@ const toRow = (item, indent = false, options) => { const missing = toMissingTd(item, options); const lastTd = options.hasMissing ? `${missing}` : ''; - // prettier-ignore - return `${name.replace(/__/g, '\\_\\_')}${stmts}${miss}${cover}${lastTd}`; + return `${name}${stmts}${miss}${cover}${lastTd}`; }; // make summary row - tr @@ -17271,7 +17270,7 @@ const toFileNameTd = (item, indent = false, options) => { const last = parts[parts.length - 1]; const space = indent ? '   ' : ''; - return `${space}${last}`; + return `${space}${last.replace(/__/g, '\\_\\_')}`; }; // make folder row - tr diff --git a/package-lock.json b/package-lock.json index 7f832d2..0e5dd70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pytest-coverage-comment", - "version": "1.1.45", + "version": "1.1.46", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pytest-coverage-comment", - "version": "1.1.45", + "version": "1.1.46", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", @@ -15,8 +15,8 @@ }, "devDependencies": { "@vercel/ncc": "^0.36.1", - "eslint": "^8.33.0", - "prettier": "^2.8.3" + "eslint": "^8.35.0", + "prettier": "^2.8.4" } }, "node_modules/@actions/core": { @@ -57,9 +57,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", + "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -79,6 +79,15 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/js": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", + "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -274,9 +283,9 @@ } }, "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -480,12 +489,13 @@ } }, "node_modules/eslint": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz", - "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", + "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.4.1", + "@eslint/eslintrc": "^2.0.0", + "@eslint/js": "8.35.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -499,7 +509,7 @@ "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.4.0", - "esquery": "^1.4.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", @@ -614,9 +624,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -765,9 +775,9 @@ } }, "node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1082,9 +1092,9 @@ } }, "node_modules/prettier": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", - "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -1097,9 +1107,9 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" @@ -1422,9 +1432,9 @@ } }, "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", + "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -1438,6 +1448,12 @@ "strip-json-comments": "^3.1.1" } }, + "@eslint/js": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", + "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "dev": true + }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -1603,9 +1619,9 @@ "dev": true }, "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-jsx": { @@ -1764,12 +1780,13 @@ } }, "eslint": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz", - "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", + "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.4.1", + "@eslint/eslintrc": "^2.0.0", + "@eslint/js": "8.35.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1783,7 +1800,7 @@ "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.4.0", - "esquery": "^1.4.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", @@ -1863,9 +1880,9 @@ } }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -1984,9 +2001,9 @@ } }, "globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -2218,15 +2235,15 @@ "dev": true }, "prettier": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", - "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true }, "queue-microtask": { diff --git a/package.json b/package.json index a7e5728..800f7e2 100644 --- a/package.json +++ b/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", @@ -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, diff --git a/src/parse.js b/src/parse.js index 1579219..d8f041d 100644 --- a/src/parse.js +++ b/src/parse.js @@ -277,8 +277,7 @@ const toRow = (item, indent = false, options) => { const missing = toMissingTd(item, options); const lastTd = options.hasMissing ? `${missing}` : ''; - // prettier-ignore - return `${name.replace(/__/g, '\\_\\_')}${stmts}${miss}${cover}${lastTd}`; + return `${name}${stmts}${miss}${cover}${lastTd}`; }; // make summary row - tr @@ -297,7 +296,7 @@ const toFileNameTd = (item, indent = false, options) => { const last = parts[parts.length - 1]; const space = indent ? '   ' : ''; - return `${space}${last}`; + return `${space}${last.replace(/__/g, '\\_\\_')}`; }; // make folder row - tr