← Back to Pull requests

chore: add husky pre-commit checks with lint-staged and prettier #273

Closed
unknown closed this pull request without merging on Apr 30, 2026 13:45 UTC
View on GitHub
unknown unknown commented on Jan 14, 2026 11:15 UTC
Author

<!-- This is a pull request template, you do not need to uncomment or remove the comments, they won't show up in the PR text. -->

<!-- Suggested PR title format examples:
feat: Adding a new feature
fix: For bug fixes that affect the end-user
refactor: A code change that doesn't change behavior (it doesn't add anything and doesn't fix anything)
chore: For small tasks
docs: For documentation
ui: For UI/design changes or improvements
perf: For performance improvements
-->

Related Tickets & Documents


<!-- Please list the issue or open one if it doesnt exist -->
Fixes: #3506

Description


  • This PR adds a fast, reliable pre-commit workflow so commits don’t slip in with lint/format issues.
  • Changes


    <!-- Provide a concise bullet-point list of key modifications. -->
  • Adds Husky pre-commit hook to run staged files only during commit.

  • Add Prettier + Tailwind plugin for consistent formatting

  • Add configuration files for lint-staged and Prettier
  • Type of Change


    <!-- Select the most appropriate option(s) -->
  • Chore (maintenance, refactoring, tooling updates)

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (change that adds functionality)

  • Breaking Change (may require updates in existing code)

  • UI improvement (visual or design changes)

  • Performance improvement (optimization or efficiency enhancements)

  • Documentation update (changes to README, guides, etc.)

  • CI (updates to continuous integration workflows)

  • Revert (undo a previous commit or merge)
  • Testing


    <!-- Please describe how these changes were tested, specify any test cases or list any relevant details. -->
  • npx lint-staged (verified it runs; requires staged files to do work)

  • Ensure the build is successful after npm run build.
  • <img width="1068" height="241" alt="Screenshot 2026-01-14 at 4 44 27 PM" src="https://github.com/user-attachments/assets/c2e8179f-7b4e-42f5-be82-828f056be878" />

    Demo


    <!--
    For UI changes, please provide:
    1. Video showing before/after
    2. Responsiveness across mobile, tablet and desktop screens
    For functional changes, include example API requests or screenshots of console output etc.
    -->
    <img width="1034" height="593" alt="Screenshot 2026-01-14 at 4 14 44 PM" src="https://github.com/user-attachments/assets/f834d854-c8b9-447f-a9e8-8446dea67f01" />

    Environment and Dependencies


  • New Dependencies: <!-- List any new packages or libraries --> husky, lint-staged, prettier, prettier-plugin-tailwindcss

  • Configuration Changes: <!-- Describe any changes needed in the environment setup --> Adds [lint-staged.config.cjs](), [.prettierrc.json](), [.prettierignore](); added Husky hook in [pre-commit]() and scripts in [package.json]()
  • Checklist


  • My code follows the style guidelines of this project

  • I have performed a self-review of my own code

  • I have made corresponding changes to the documentation

  • I have added corresponding tests

  • I have run the build command to ensure there are no build errors

  • [ ] My changes have been tested across relevant browsers/devices

  • For UI changes, I've included visual evidence of my changes
  • <!--- Thanks for contributing to our blog website! If the tests fail or you have questions, please leave a comment below and our team will be happy to assist you. --->

    Diff: 433 lines (+324 / -109) across 5 files Reviewer: syedali237 Review duration: 152789m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 433 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #273"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.2% (MEDIUM) · Higher = larger blast radius
    45.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%