Skip to content

Conversation

@lollipopkit
Copy link
Owner

@lollipopkit lollipopkit commented Jan 23, 2026

Summary

  • Run pre-commit checks (when configured and available) as part of the devloop validation step.
  • Document the behavior in devloop README (EN + zh-CN).

Test plan

  • Ensure a repo with .pre-commit-config.yaml triggers validator to run pre-commit.
  • Ensure validator reports and skips when pre-commit is not installed.

Closes #27

Summary by CodeRabbit

  • New Features

    • Validator now runs repository pre-commit hook scripts (when present) as part of validation to surface issues earlier.
  • Documentation

    • Updated English and Chinese docs to explain the pre-commit hook execution during validation and show where to configure it.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

Validator and documentation updates add execution of repository pre-commit hook scripts during validation: if ./.husky/pre-commit exists run it, else if .git/hooks/pre-commit exists run that, otherwise report the step as skipped. English and Chinese docs updated with corresponding notes.

Changes

Cohort / File(s) Summary
Documentation (English & Chinese)
plugins/devloop/README.md, plugins/devloop/README.zh-CN.md
Added Notes under configuration explaining that if the repository contains a pre-commit hook script (e.g. ./.husky/pre-commit), the validator will run that hook during validation to surface CI issues earlier.
Validator Workflow
plugins/devloop/agents/devloop-validator.md
Introduced conditional hook execution: run ./.husky/pre-commit if present, else run .git/hooks/pre-commit if present, else report the hook step was skipped. No other public APIs changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(devloop): support pre-commit checks' clearly and specifically describes the main change—adding pre-commit check support to the devloop plugin.
Linked Issues check ✅ Passed The PR implements all requirements from issue #27: detects pre-commit hooks at .husky/pre-commit and .git/hooks/pre-commit, executes them during validation, handles absence gracefully, and documents the behavior in both English and zh-CN READMEs.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing pre-commit check support in devloop: validator logic updates, English README documentation, and Chinese README documentation—no unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/devloop-pre-commit-checks-27

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 23, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@plugins/devloop/README.md`:
- Around line 36-38: The README and implementation disagree: the code currently
documents/checks for ./.husky/pre-commit and .git/hooks/pre-commit hook scripts
but the PR goal was to detect .pre-commit-config.yaml and run the Python
pre-commit tool (pre-commit run --all-files) while handling missing pre-commit;
update either the docs or the implementation to match: if you want to support
the pre-commit framework, modify the validator to detect .pre-commit-config.yaml
and invoke "pre-commit run --all-files" (gracefully handle when pre-commit is
not installed) and remove or clearly document hook-script fallback, or if you
intend to run arbitrary hook scripts, update README to explicitly state both ./
.husky/pre-commit and .git/hooks/pre-commit are checked and clarify the behavior
when those scripts are present versus when .pre-commit-config.yaml exists.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e91cea and 021da8f.

📒 Files selected for processing (3)
  • plugins/devloop/README.md
  • plugins/devloop/README.zh-CN.md
  • plugins/devloop/agents/devloop-validator.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/devloop/README.zh-CN.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Markdown linting must ensure compliance with .markdownlint.json configuration which disables MD013 and MD041 rules

Files:

  • plugins/devloop/README.md
  • plugins/devloop/agents/devloop-validator.md
🧠 Learnings (1)
📚 Learning: 2026-01-17T04:29:56.872Z
Learnt from: CR
Repo: lollipopkit/cc-plugins PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-17T04:29:56.872Z
Learning: Plugins should read per-project configuration from the target project's `.claude/<plugin-name>.local.md` file for local settings

Applied to files:

  • plugins/devloop/README.md
🔇 Additional comments (1)
plugins/devloop/agents/devloop-validator.md (1)

15-18: The primary inconsistency claim cannot be verified in the codebase.

A thorough search found no evidence of PR objectives describing the pre-commit tool (as opposed to git hook scripts). In fact, the README.md line 38 states: "If your repo contains a pre-commit hook script (e.g. ./.husky/pre-commit), the validator step will run it," which aligns with the implementation in lines 15-18. Both consistently reference git hook scripts, not the pre-commit tool. The git commit message ("feat(devloop): run pre-commit hook script in validator") suggests this behavior was intentional.

However, the secondary concern about exit code handling is valid: the instructions should clarify whether hook script failures should halt validation or merely be reported. Consider adding guidance like:

  • If the hook exits with a non-zero status, report the failure and stop validation
  • If no hook script exists, report that you skipped this step.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +36 to +38
Notes:

- If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Major inconsistency between PR objectives and implementation.

The PR objectives state that the validator should "run pre-commit checks (when configured and available)" by detecting .pre-commit-config.yaml and executing the pre-commit tool. However, the implementation actually runs git hook scripts at ./.husky/pre-commit or .git/hooks/pre-commit, which are different:

  • Expected (per PR objectives): Detect .pre-commit-config.yaml → run pre-commit run --all-files → handle when pre-commit is not installed
  • Actual (per implementation): Check for ./.husky/pre-commit or .git/hooks/pre-commit scripts → run the script if it exists → skip if neither exists

The pre-commit framework (Python-based) and arbitrary git hook scripts are not the same thing. Many repositories use .git/hooks/pre-commit or Husky hooks without using the pre-commit tool at all.

Additionally, the documentation only mentions ./.husky/pre-commit as an example but omits that .git/hooks/pre-commit is also checked as a fallback.

📝 Suggested documentation improvement

If the implementation is correct and you intend to run arbitrary hook scripts:

-If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier.
+If your repo contains a pre-commit hook script (e.g., `./.husky/pre-commit` or `.git/hooks/pre-commit`), the validator step will run it to help catch CI failures earlier.

If the PR objectives are correct and you intend to run the pre-commit tool:

-If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier.
+If your repo contains a `.pre-commit-config.yaml` configuration file, the validator step will run `pre-commit` checks to help catch CI failures earlier.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Notes:
- If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier.
Notes:
- If your repo contains a pre-commit hook script (e.g., `./.husky/pre-commit` or `.git/hooks/pre-commit`), the validator step will run it to help catch CI failures earlier.
Suggested change
Notes:
- If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier.
Notes:
- If your repo contains a `.pre-commit-config.yaml` configuration file, the validator step will run `pre-commit` checks to help catch CI failures earlier.
🤖 Prompt for AI Agents
In `@plugins/devloop/README.md` around lines 36 - 38, The README and
implementation disagree: the code currently documents/checks for
./.husky/pre-commit and .git/hooks/pre-commit hook scripts but the PR goal was
to detect .pre-commit-config.yaml and run the Python pre-commit tool (pre-commit
run --all-files) while handling missing pre-commit; update either the docs or
the implementation to match: if you want to support the pre-commit framework,
modify the validator to detect .pre-commit-config.yaml and invoke "pre-commit
run --all-files" (gracefully handle when pre-commit is not installed) and remove
or clearly document hook-script fallback, or if you intend to run arbitrary hook
scripts, update README to explicitly state both ./ .husky/pre-commit and
.git/hooks/pre-commit are checked and clarify the behavior when those scripts
are present versus when .pre-commit-config.yaml exists.

@lollipopkit lollipopkit deleted the feat/devloop-pre-commit-checks-27 branch January 24, 2026 01:58
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.

feat: devloop supports pre-commit checks

2 participants