Skip to content

chore: move validation to pre-commit and add auto changelog command

Kushal Lagichetty requested to merge fix/precommit into main

MR Title

Shift full validation to pre-commit and add npm run changelog auto-entry workflow

MR Description

This MR updates the local Git hook workflow so checks happen at commit time instead of push time, and introduces an auto changelog command for faster contributor workflow.

Changes Included

  1. Updated .githooks/pre-commit to run:
    • npm run validate:staged
    • npm run validate
  2. Updated .githooks/pre-push to no-op (exit 0).
  3. Added changelog script in package.json:
    • npm run changelog -> node scripts/updateChangelog.js --auto
  4. Enhanced scripts/updateChangelog.js:
    • supports auto mode
    • detects staged/working-tree changed files
    • inserts generated entry under ## [Unreleased]
    • keeps manual --message mode intact
  5. Updated docs:
    • CONTRIBUTING.md
    • CHANGELOG.md

Validation

  1. node --check scripts/updateChangelog.js passes.
  2. Hook scripts and docs reflect new pre-commit/pre-push behavior.
  3. npm run changelog and npm run changelog:update -- --message "..." both supported.

Merge request reports

Loading