-
Notifications
You must be signed in to change notification settings - Fork 0
π‘οΈ Automate Pint --test & CHANGELOG Validation #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
β¦n into automation SPDX-FileCopyrightText: 2025 SecPal SPDX-License-Identifier: AGPL-3.0-or-later WHY: Critical learnings from PR #74 were documented in SELF_REVIEW_CHECKLIST.md but NOT integrated into automated quality gates. This created a gap where the same Pint false-confidence issue could happen again. WHAT CHANGED: 1. scripts/preflight.sh - Pint Workflow (CRITICAL FIX): - OLD: Only runs "pint --dirty" (auto-fix) - NEW: Runs "pint --test --dirty" β "pint --dirty" β "pint --test --dirty" - Matches documented workflow from SELF_REVIEW_CHECKLIST.md - Ensures CI parity (CI uses --test flag) - Prevents false confidence from auto-fix hiding issues 2. .pre-commit-config.yaml - Add Pint Hook: - Added local hook for Laravel Pint with --dirty flag - Auto-fixes code style on commit - Works in tandem with preflight.sh verification 3. scripts/preflight.sh - CHANGELOG Validation: - Checks for [Unreleased] section on feature/fix/refactor branches - Warns if section is empty - Exempts docs/* and chore/* branches - Enforces org-wide CHANGELOG policy automatically IMPACT: - Prevents PR #74 Pint issue from recurring (auto-fix masking problems) - Reduces reliance on AI/human discipline - Enforces CHANGELOG updates before push - All documented best practices now automated TESTING: Ran ./scripts/preflight.sh successfully: - Pint check-fix-verify workflow executed correctly - All 127 tests passing - CHANGELOG validation working
π‘ Tip: Consider Using Draft PRsBenefits of opening PRs as drafts initially:
How to convert:
This is just a friendly reminder - feel free to continue as is! π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a check-first workflow for Laravel Pint and adds CHANGELOG validation to ensure CI parity and proper documentation maintenance. The changes align with established coding guidelines documented in SELF_REVIEW_CHECKLIST.md and .github/copilot-instructions.md.
Key Changes
- Updated Pint workflow in
preflight.shto check first (--test --dirty), auto-fix if needed, then verify - Added Pint pre-commit hook to auto-fix changed files
- Implemented CHANGELOG validation to ensure
[Unreleased]section has content on non-docs branches
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/preflight.sh | Refactored run_pint() to implement check-first workflow and added CHANGELOG validation checks |
| .pre-commit-config.yaml | Added Laravel Pint hook to auto-fix changed files during pre-commit |
SPDX-FileCopyrightText: 2025 SecPal SPDX-License-Identifier: AGPL-3.0-or-later Address 3 Copilot review comments on PR #77: 1. Magic number 3 β MIN_CHANGELOG_LINES variable with comment 2. Hardcoded branch pattern β CHANGELOG_EXEMPT_PREFIXES config 3. Fragile sed/grep β Robust line-number-based extraction Changes: - Extract config variables to top of CHANGELOG validation block - Add ci/* and test/* to exempt branch prefixes - Rewrite content extraction to handle [Unreleased] as last section - Update CHANGELOG.md with new features from this PR
π‘ Tip: Consider Using Draft PRsBenefits of opening PRs as drafts initially:
How to convert:
This is just a friendly reminder - feel free to continue as is! π |
π‘ Tip: Consider Using Draft PRsBenefits of opening PRs as drafts initially:
How to convert:
This is just a friendly reminder - feel free to continue as is! π |
π‘οΈ Feature: Automate Pint & CHANGELOG Validation
Context: Post-PR #74 learnings documented in SELF_REVIEW_CHECKLIST.md were NOT integrated into automated quality gates. This PR closes that gap.
π― Problem Solved
Critical Gap: preflight.sh only ran
pint --dirty(auto-fix), notpint --test --dirty(CI parity check). This meant:pint --testwould catchπ Changes
1. scripts/preflight.sh - Pint Workflow (CRITICAL)
Before:
After:
Impact:
2. .pre-commit-config.yaml - Add Pint Hook
Impact:
--dirty)3. scripts/preflight.sh - CHANGELOG Validation
Impact:
π Why This Matters
Before this PR:
After this PR:
β Testing
Ran
./scripts/preflight.shsuccessfully:π Related
.githubrepo validation scriptReview Focus: Verify Pint workflow matches SELF_REVIEW_CHECKLIST.md exactly. Check CHANGELOG validation logic for edge cases.