Skip to content

Fix bad truncation html formatting around </details> in primer comments#10932

Merged
Pierre-Sassoulas merged 2 commits intopylint-dev:mainfrom
Pierre-Sassoulas:fix-double-details-in-primer
Mar 21, 2026
Merged

Fix bad truncation html formatting around </details> in primer comments#10932
Pierre-Sassoulas merged 2 commits intopylint-dev:mainfrom
Pierre-Sassoulas:fix-double-details-in-primer

Conversation

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Mar 20, 2026

Type of Changes

Type
🐛 Bug fix

Description

  • Remove extra blank lines inside
    Details blocks and between sections
  • Fix duplicate tag emitted when missing_messages was truthy but had no actual messages (wrong truthiness check on dict vs dict["messages"])
  • Close any
    Details tag left open when a comment is truncated mid-block, preventing the rest of the PR page from collapsing into the hidden section

This is a small fix before tackling #10914

- Remove extra blank line between header and first package section
- Remove blank lines inside <details> blocks for cleaner markdown
- Fix duplicate </details> when new_messages exist but missing_messages don't
  (checked `missing_messages` dict truthiness instead of `missing_messages["messages"]`)
@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news 🔇 This change does not require a changelog entry labels Mar 20, 2026
Comment on lines -13 to -16

</details>


Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual bug, everything else is "style"

@github-actions

This comment has been minimized.

When truncation cuts inside an open <details> block, the closing tag
was missing, causing GitHub to render the rest of the PR comment inside
the collapsed section. Now detect the open tag and close it before
appending the truncation notice. Add a dedicated test case for this.
@Pierre-Sassoulas Pierre-Sassoulas changed the title Fix extra blank lines and duplicate </details> in primer comment Fix bad truncation html formatting around </details> in primer comments Mar 20, 2026
Comment on lines +8 to +11
<details>
1) locally-disabled:
*Locally disabling redefined-builtin [we added some text in the message...
</details>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not have been closed properly previousely.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit b8279be

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.16%. Comparing base (25dde54) to head (b8279be).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10932   +/-   ##
=======================================
  Coverage   96.16%   96.16%           
=======================================
  Files         178      178           
  Lines       19627    19632    +5     
=======================================
+ Hits        18875    18880    +5     
  Misses        752      752           
Files with missing lines Coverage Δ
pylint/testutils/_primer/primer_compare_command.py 95.31% <100.00%> (+0.39%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pierre-Sassoulas Pierre-Sassoulas merged commit a3476b2 into pylint-dev:main Mar 21, 2026
44 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the fix-double-details-in-primer branch March 21, 2026 18:00
@jacobtylerwalls jacobtylerwalls removed their request for review March 21, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news 🔇 This change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants