Skip to content

Commit 25a4660

Browse files
MishaKavclaude
andauthored
Add hide-emoji option to disable emojis in summary table (#251) (#254)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d572ff commit 25a4660

10 files changed

Lines changed: 73 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog of the Pytest Coverage Comment
22

3+
## [Pytest Coverage Comment 1.5.0](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.5.0)
4+
5+
**Release Date:** 2026-02-28
6+
7+
#### Changes
8+
9+
- feat: add `hide-emoji` option to hide emoji shortcodes from the test summary table (#251)
10+
- docs: update README examples to use `@v1` tag and latest action versions (`checkout@v6`, `setup-python@v6`)
11+
312
## [Pytest Coverage Comment 1.4.0](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.4.0)
413

514
**Release Date:** 2026-02-22

README.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Add this action to your workflow:
9191

9292
```yaml
9393
- name: Pytest coverage comment
94-
uses: MishaKav/pytest-coverage-comment@main
94+
uses: MishaKav/pytest-coverage-comment@v1
9595
with:
9696
pytest-coverage-path: ./pytest-coverage.txt
9797
junitxml-path: ./pytest.xml
@@ -115,10 +115,10 @@ jobs:
115115
test:
116116
runs-on: ubuntu-latest
117117
steps:
118-
- uses: actions/checkout@v4
118+
- uses: actions/checkout@v6
119119

120120
- name: Set up Python
121-
uses: actions/setup-python@v5
121+
uses: actions/setup-python@v6
122122
with:
123123
python-version: 3.11
124124

@@ -131,7 +131,7 @@ jobs:
131131
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt
132132
133133
- name: Pytest coverage comment
134-
uses: MishaKav/pytest-coverage-comment@main
134+
uses: MishaKav/pytest-coverage-comment@v1
135135
with:
136136
pytest-coverage-path: ./pytest-coverage.txt
137137
junitxml-path: ./pytest.xml
@@ -167,6 +167,7 @@ jobs:
167167
| `hide-badge` | `false` | Hide the coverage percentage badge from the comment |
168168
| `hide-report` | `false` | Hide the detailed coverage table (show only summary and badge) |
169169
| `hide-comment` | `false` | Skip creating PR comment entirely (useful for using outputs only) |
170+
| `hide-emoji` | `false` | Hide emojis from the test summary table |
170171
| `report-only-changed-files` | `false` | Show only files changed in the current pull request |
171172
| `xml-skip-covered` | `false` | Hide files with 100% coverage from XML coverage reports |
172173
| `remove-link-from-badge` | `false` | Remove hyperlink from coverage badge (badge becomes plain image) |
@@ -223,7 +224,7 @@ jobs:
223224
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt
224225
225226
- name: Coverage comment
226-
uses: MishaKav/pytest-coverage-comment@main
227+
uses: MishaKav/pytest-coverage-comment@v1
227228
with:
228229
pytest-coverage-path: ./pytest-coverage.txt
229230
junitxml-path: ./pytest.xml
@@ -242,7 +243,7 @@ jobs:
242243
pytest --cov-report=xml:coverage.xml --cov=src tests/
243244
244245
- name: Coverage comment
245-
uses: MishaKav/pytest-coverage-comment@main
246+
uses: MishaKav/pytest-coverage-comment@v1
246247
with:
247248
pytest-xml-coverage-path: ./coverage.xml
248249
junitxml-path: ./pytest.xml
@@ -257,7 +258,7 @@ jobs:
257258

258259
```yaml
259260
- name: Coverage comment
260-
uses: MishaKav/pytest-coverage-comment@main
261+
uses: MishaKav/pytest-coverage-comment@v1
261262
with:
262263
multiple-files: |
263264
Backend API, ./backend/pytest-coverage.txt, ./backend/pytest.xml
@@ -279,6 +280,32 @@ This creates a consolidated table showing all coverage reports:
279280

280281
</details>
281282

283+
### Clean Summary Without Emojis
284+
285+
<details>
286+
<summary>Hide emojis for a cleaner appearance</summary>
287+
288+
```yaml
289+
- name: Coverage comment
290+
uses: MishaKav/pytest-coverage-comment@v1
291+
with:
292+
pytest-coverage-path: ./pytest-coverage.txt
293+
junitxml-path: ./pytest.xml
294+
hide-emoji: true
295+
```
296+
297+
**Default behavior** (with emojis):
298+
| Tests | Skipped | Failures | Errors | Time |
299+
| ----- | ------- | -------- | ------ | ---- |
300+
| 109 | 2 :zzz: | 1 :x: | 0 :fire: | 0.583s :stopwatch: |
301+
302+
**With `hide-emoji: true`**:
303+
| Tests | Skipped | Failures | Errors | Time |
304+
| ----- | ------- | -------- | ------ | ---- |
305+
| 109 | 2 | 1 | 0 | 0.583s |
306+
307+
</details>
308+
282309
### Docker Workflows
283310

284311
<details>
@@ -294,7 +321,7 @@ This creates a consolidated table showing all coverage reports:
294321
--cov=src tests/ | tee /tmp/pytest-coverage.txt
295322
296323
- name: Coverage comment
297-
uses: MishaKav/pytest-coverage-comment@main
324+
uses: MishaKav/pytest-coverage-comment@v1
298325
with:
299326
pytest-coverage-path: /tmp/pytest-coverage.txt
300327
junitxml-path: /tmp/pytest.xml
@@ -315,7 +342,7 @@ strategy:
315342
316343
steps:
317344
- name: Coverage comment
318-
uses: MishaKav/pytest-coverage-comment@main
345+
uses: MishaKav/pytest-coverage-comment@v1
319346
with:
320347
pytest-coverage-path: ./pytest-coverage.txt
321348
junitxml-path: ./pytest.xml
@@ -352,7 +379,7 @@ jobs:
352379
update-badge:
353380
runs-on: ubuntu-latest
354381
steps:
355-
- uses: actions/checkout@v4
382+
- uses: actions/checkout@v6
356383
with:
357384
persist-credentials: false
358385
fetch-depth: 0
@@ -363,7 +390,7 @@ jobs:
363390
364391
- name: Coverage comment
365392
id: coverage
366-
uses: MishaKav/pytest-coverage-comment@main
393+
uses: MishaKav/pytest-coverage-comment@v1
367394
with:
368395
pytest-coverage-path: ./pytest-coverage.txt
369396
junitxml-path: ./pytest.xml
@@ -399,7 +426,7 @@ Here's what the generated coverage comment looks like:
399426

400427
```yaml
401428
- name: Coverage comment
402-
uses: MishaKav/pytest-coverage-comment@main
429+
uses: MishaKav/pytest-coverage-comment@v1
403430
with:
404431
pytest-coverage-path: ./pytest-coverage.txt
405432
junitxml-path: ./pytest.xml
@@ -416,7 +443,7 @@ Displays coverage as `85% (42/50)` instead of a badge image.
416443
```yaml
417444
- name: Coverage comment
418445
id: coverage
419-
uses: MishaKav/pytest-coverage-comment@main
446+
uses: MishaKav/pytest-coverage-comment@v1
420447
with:
421448
pytest-coverage-path: ./pytest-coverage.txt
422449
junitxml-path: ./pytest.xml
@@ -445,7 +472,7 @@ Displays coverage as `85% (42/50)` instead of a badge image.
445472

446473
```yaml
447474
- name: Coverage comment (changed files only)
448-
uses: MishaKav/pytest-coverage-comment@main
475+
uses: MishaKav/pytest-coverage-comment@v1
449476
with:
450477
pytest-coverage-path: ./pytest-coverage.txt
451478
junitxml-path: ./pytest.xml
@@ -473,7 +500,7 @@ jobs:
473500
runs-on: ubuntu-latest
474501
steps:
475502
- name: Coverage comment
476-
uses: MishaKav/pytest-coverage-comment@main
503+
uses: MishaKav/pytest-coverage-comment@v1
477504
with:
478505
pytest-coverage-path: ./pytest-coverage.txt
479506
junitxml-path: ./pytest.xml
@@ -489,7 +516,7 @@ For large coverage reports that might exceed GitHub's comment size limits:
489516

490517
```yaml
491518
- name: Coverage comment
492-
uses: MishaKav/pytest-coverage-comment@main
519+
uses: MishaKav/pytest-coverage-comment@v1
493520
with:
494521
pytest-coverage-path: ./pytest-coverage.txt
495522
junitxml-path: ./pytest.xml

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ inputs:
5656
default: 'false'
5757
required: false
5858

59+
hide-emoji:
60+
description: 'Hide emojis in the test summary table (skipped/failures/errors/time columns)'
61+
default: 'false'
62+
required: false
63+
5964
xml-skip-covered:
6065
description: 'Hide files with 100% coverage from XML coverage reports'
6166
default: 'false'

dist/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38118,9 +38118,10 @@ const toMarkdown = (summary, options) => {
3811838118
time > 60
3811938119
? `${(time / 60) | 0}m ${(time % 60) | 0}s`
3812038120
: `${time.toFixed(3)}s`;
38121+
const e = (emoji) => (options.hideEmoji ? '' : ` ${emoji}`);
3812138122
const table = `| Tests | Skipped | Failures | Errors | Time |
3812238123
| ----- | ------- | -------- | -------- | ------------------ |
38123-
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
38124+
| ${tests} | ${skipped}${e(':zzz:')} | ${failures}${e(':x:')} | ${errors}${e(':fire:')} | ${displayTime}${e(':stopwatch:')} |
3812438125
`;
3812538126

3812638127
if (options.xmlTitle) {
@@ -38246,7 +38247,8 @@ const getMultipleReport = (options) => {
3824638247
const { errors, failures, skipped, tests, time } = summary;
3824738248
const displayTime =
3824838249
time > 60 ? `${(time / 60) | 0}m ${(time % 60) | 0}s` : `${time}s`;
38249-
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
38250+
const e = (emoji) => (options.hideEmoji ? '' : ` ${emoji}`);
38251+
table += `| ${tests} | ${skipped}${e(':zzz:')} | ${failures}${e(':x:')} | ${errors}${e(':fire:')} | ${displayTime}${e(':stopwatch:')} |
3825038252
`;
3825138253
} else {
3825238254
table += `
@@ -43842,6 +43844,7 @@ const main = async () => {
4384243844
required: false,
4384343845
});
4384443846
const hideComment = core.getBooleanInput('hide-comment', { required: false });
43847+
const hideEmoji = core.getBooleanInput('hide-emoji', { required: false });
4384543848
const xmlSkipCovered = core.getBooleanInput('xml-skip-covered', {
4384643849
required: false,
4384743850
});
@@ -43902,6 +43905,7 @@ const main = async () => {
4390243905
hideReport,
4390343906
createNewComment,
4390443907
hideComment,
43908+
hideEmoji,
4390543909
xmlSkipCovered,
4390643910
reportOnlyChangedFiles,
4390743911
removeLinkFromBadge,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pytest-coverage-comment",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
55
"author": "Misha Kav",
66
"license": "MIT",

src/cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const main = async () => {
6767
reportOnlyChangedFiles: false,
6868
removeLinkFromBadge: false,
6969
hideComment: false,
70+
hideEmoji: false,
7071
xmlSkipCovered: false,
7172
xmlTitle: '',
7273
// multipleFiles,

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ const main = async () => {
192192
required: false,
193193
});
194194
const hideComment = core.getBooleanInput('hide-comment', { required: false });
195+
const hideEmoji = core.getBooleanInput('hide-emoji', { required: false });
195196
const xmlSkipCovered = core.getBooleanInput('xml-skip-covered', {
196197
required: false,
197198
});
@@ -252,6 +253,7 @@ const main = async () => {
252253
hideReport,
253254
createNewComment,
254255
hideComment,
256+
hideEmoji,
255257
xmlSkipCovered,
256258
reportOnlyChangedFiles,
257259
removeLinkFromBadge,

src/junitXml.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ const toMarkdown = (summary, options) => {
111111
time > 60
112112
? `${(time / 60) | 0}m ${(time % 60) | 0}s`
113113
: `${time.toFixed(3)}s`;
114+
const e = (emoji) => (options.hideEmoji ? '' : ` ${emoji}`);
114115
const table = `| Tests | Skipped | Failures | Errors | Time |
115116
| ----- | ------- | -------- | -------- | ------------------ |
116-
| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
117+
| ${tests} | ${skipped}${e(':zzz:')} | ${failures}${e(':x:')} | ${errors}${e(':fire:')} | ${displayTime}${e(':stopwatch:')} |
117118
`;
118119

119120
if (options.xmlTitle) {

src/multiFiles.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ const getMultipleReport = (options) => {
105105
const { errors, failures, skipped, tests, time } = summary;
106106
const displayTime =
107107
time > 60 ? `${(time / 60) | 0}m ${(time % 60) | 0}s` : `${time}s`;
108-
table += `| ${tests} | ${skipped} :zzz: | ${failures} :x: | ${errors} :fire: | ${displayTime} :stopwatch: |
108+
const e = (emoji) => (options.hideEmoji ? '' : ` ${emoji}`);
109+
table += `| ${tests} | ${skipped}${e(':zzz:')} | ${failures}${e(':x:')} | ${errors}${e(':fire:')} | ${displayTime}${e(':stopwatch:')} |
109110
`;
110111
} else {
111112
table += `

0 commit comments

Comments
 (0)