Skip to content

refactor: improve PR comment to be more professional and informative#6

Merged
machado144 merged 1 commit intomainfrom
feat/improve-pr-comment
Mar 8, 2026
Merged

refactor: improve PR comment to be more professional and informative#6
machado144 merged 1 commit intomainfrom
feat/improve-pr-comment

Conversation

@machado144
Copy link
Contributor

Summary

  • Replace bare metrics table with contextual pass/total ratio and config path reference
  • Each violation category rendered as its own collapsible <details> section instead of one monolithic block
  • Truncated examples now show "…and N more" count
  • Clean single-line success message (no table with zeros)
  • Subtle footer linking to the full workflow run and StructLint repo

Before

## ✅ StructLint Validation

| Metric | Count |
|--------|-------|
| Checks passed | 12 |
| Violations | 3 |

<details>
<summary>Violation Details</summary>

### ⚠️ Files not matching any allowed naming pattern (3)
- `Disallowed file naming pattern found: ...`
- `Disallowed file naming pattern found: ...`
- `Disallowed file naming pattern found: ...`
</details>

After (pass)

## StructLint — All checks passed

**12** rules validated against `.structlint.yaml`. No violations found.

---
View full run · Powered by StructLint

After (fail)

## StructLint — 3 violation(s) found

**9**/12 rules passed · **3** violation(s) detected against `.structlint.yaml`.

▸ Files not matching any allowed naming pattern (3)
  - `Disallowed file naming pattern found: ...`
  - `Disallowed file naming pattern found: ...`
  - …and 1 more

---
View full run · Powered by StructLint

Test plan

  • Trigger workflow on a clean repo — verify success comment renders correctly
  • Trigger workflow with intentional violations — verify collapsible categories and truncation
  • Verify "View full run" link points to the correct workflow run

🤖 Generated with Claude Code

- Show config file path and pass/total ratio for context
- Each violation category gets its own collapsible section
- Show "…and N more" when examples are truncated
- Clean success message without unnecessary table
- Subtle footer with link to full run and StructLint repo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

⚠️ Invalid PR Title

PR title must follow the Conventional Commits format since we use squash merge:

<type>[optional scope][!]: <description>

Allowed types: feat, fix, docs, style, refactor, test, chore, build, ci, perf, revert

Examples:

  • feat: add new feature
  • fix(api): resolve null pointer
  • feat!: breaking change
  • chore(deps): update dependencies

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

✅ StructLint Validation

Metric Count
Checks passed 75
Violations 0

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Refactored the GitHub Action's summary generation to provide a more detailed and user-friendly output.
  • Introduced a new format for success and failure messages, including a pass/total ratio and reference to the config path.
  • Enhanced violation reporting by rendering each category in a collapsible <details> section, with truncated examples and a count of remaining violations.
  • Added a subtle footer with links to the full workflow run and the StructLint repository.

Verdict

Approve: The changes significantly improve the readability and utility of the GitHub Action's output without introducing any functional regressions or critical issues.


Code review performed by GEMINI - gemini-2.5-flash.

@machado144 machado144 changed the title Improve PR comment quality refactor: improve PR comment to be more professional and informative Mar 8, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Refactored the GitHub Actions job summary and PR comment generation logic to provide a more professional and informative output.
  • Introduced a new markdown format for both successful and failed validation runs, including a clear pass/fail ratio and reference to the config path.
  • Implemented collapsible <details> sections for each violation category, with truncated examples and a count of remaining violations.
  • Added a subtle footer linking to the full workflow run and the StructLint repository.

Verdict

Approve: The changes correctly implement the described improvements to the action's output, enhancing readability and professionalism without introducing any functional regressions or critical issues.


Code review performed by GEMINI - gemini-2.5-flash.

@machado144 machado144 merged commit 6a5e3c1 into main Mar 8, 2026
7 of 8 checks passed
@machado144 machado144 deleted the feat/improve-pr-comment branch March 8, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant