Skip to content

feat: add pre-commit hooks, linting, and Claude Code setup#70

Open
pdettori wants to merge 2 commits intomainfrom
orchestrate/precommit
Open

feat: add pre-commit hooks, linting, and Claude Code setup#70
pdettori wants to merge 2 commits intomainfrom
orchestrate/precommit

Conversation

@pdettori
Copy link
Collaborator

Summary

Phase 2 of repo orchestration — establishes the code quality baseline.

  • .pre-commit-config.yaml: extends existing hooks with a local commit-msg hook that enforces DCO sign-off and blocks Co-Authored-By AI attribution (requires Assisted-By instead)
  • Makefile: adds make fmt target using ruff format
  • CLAUDE.md: repo overview with structure, key commands, code style, and DCO guidance for Claude Code sessions
  • .claude/settings.json: allowed Bash permissions for Claude Code auto-approval
  • scripts/hooks/commit-msg: hook script enforcing DCO and AI attribution convention

Install hooks

pre-commit install --hook-type pre-commit --hook-type commit-msg

Test plan

  • `make lint` passes on existing code
  • `make fmt` runs without error
  • `git commit` without `-s` is rejected by commit-msg hook
  • `git commit -s` succeeds

- Extend .pre-commit-config.yaml with local DCO commit-msg hook
- Add `make fmt` target (ruff format)
- Create CLAUDE.md with repo overview, commands, and conventions
- Add .claude/settings.json with allowed Bash permissions
- Add scripts/hooks/commit-msg to enforce DCO sign-off and block
  Co-Authored-By AI attribution (use Assisted-By instead)

Pre-commit install: `pre-commit install --hook-type pre-commit --hook-type commit-msg`

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
make lint runs pre-commit --all-files which includes ruff-format (via
the ruff-pre-commit hook). A separate make fmt target is redundant.

Addresses review comment from evaline-ju on PR #70.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori
Copy link
Collaborator Author

Addressed @evaline-ju's comment: removed the fmt target — make lint already runs pre-commit --all-files which includes ruff-format, so the separate target was redundant. Also updated CLAUDE.md to reflect this (combined into Lint + Format | make lint).

"Bash(ls:*)",
"Bash(find:*)",
"Bash(make lint:*)",
"Bash(make fmt:*)",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this one doesn't exist anymore

Copy link
Contributor

@evaline-ju evaline-ju left a comment

Choose a reason for hiding this comment

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

/lgtm with nit

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.

2 participants