Skip to content

chore: add pre-commit githooks and update gitignore#14

Open
aritro2002 wants to merge 1 commit into
mainfrom
chore/add-githooks-and-update-gitignore
Open

chore: add pre-commit githooks and update gitignore#14
aritro2002 wants to merge 1 commit into
mainfrom
chore/add-githooks-and-update-gitignore

Conversation

@aritro2002
Copy link
Copy Markdown
Contributor

@aritro2002 aritro2002 commented May 6, 2026

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Adds pre-commit git hooks and updates .gitignore to improve developer experience and code hygiene.

  • Added .githooks/commit-msg with the following pre-commit checks:
    • ReScript formatting via npm run re:format
    • Trailing whitespace detection in src/
    • Conventional commit message validation (feat, fix, chore, refactor, docs, test, style, enhancement, ci, revert)
    • Secret scanning via gitleaks (auto-installs via Homebrew if not found)
  • Added setup:hooks script to configure core.hooksPath and set correct file permissions
  • Added postinstall to auto-run setup:hooks after npm install
  • Added pre-commit script for manual hook invocation
  • Added husky as a devDependency for git hook integration
  • Updated .gitignore to cover build outputs, editor configs, logs, env files, OS artifacts, and AI agent directories (.claude/, .cursor/, .copilot/, etc.)

How did you test it?

  • Manually triggered npm run pre-commit to verify each check runs correctly
  • Tested commit message rejection with a non-conventional message
  • Verified formatting check runs and passes on clean ReScript files
  • Confirmed hooks are applied automatically after npm install via postinstall

Usage Notes

  • No breaking changes. No API changes.
  • New contributors will have hooks set up automatically after npm install
  • gitleaks will be auto-installed via Homebrew on macOS if not already present

Version Update

  • I have bumped the package version in package.json following semantic versioning:
    • x.x.x for major changes (breaking).
    • x.x.x for minor changes (new feature, no breaking changes).
    • 2.3.1 for patch changes (bug fixes, minor improvements).

Checklist

  • I ran npm run re:build and verified the build artifacts.
  • I reviewed the code for style, readability, and consistency.
  • I verified the changes are backward compatible (if applicable).
  • I tested this change in a real or simulated consuming project.
  • I updated documentation, README, or usage examples if necessary.

Screenshots or Logs

image image

@aritro2002 aritro2002 self-assigned this May 6, 2026
@aritro2002 aritro2002 added the enhancement New feature or request label May 6, 2026
@aritro2002 aritro2002 force-pushed the chore/add-githooks-and-update-gitignore branch from 00d3f50 to 8bacfd4 Compare May 6, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant