Skip to content

chore: sync core infrastructure (shell hooks, post-edit pattern, yamllint)#6

Merged
gamaware merged 2 commits into
mainfrom
chore/sync-core-infrastructure
Mar 22, 2026
Merged

chore: sync core infrastructure (shell hooks, post-edit pattern, yamllint)#6
gamaware merged 2 commits into
mainfrom
chore/sync-core-infrastructure

Conversation

@gamaware

@gamaware gamaware commented Mar 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add shellcheck + shellharden pre-commit hooks for shell script validation
  • Rewrite .claude/hooks/post-edit.sh to use TOOL_INPUT_FILE_PATH env var pattern with shellharden auto-fix for .sh and markdownlint for .md
  • Update .yamllint.yml: reduce line-length to 120, use check-keys: false for truthy, use consistent indent-sequences
  • Add Shell Scripts section and update hooks documentation in CLAUDE.md
  • Remove empty duplicate directories (.claude/hooks 2, .claude/skills 2)

Test plan

  • pre-commit run --all-files passes (all 20 hooks green)
  • CI quality checks pass
  • CI security scan passes
  • CodeRabbit review addressed
  • Copilot review addressed

Summary by CodeRabbit

  • Chores
    • Added shell script validation tools for improved code quality and compliance checking
    • Updated YAML linting configuration for stricter formatting standards
    • Enhanced developer documentation with shell script best practices and requirements

Copilot AI review requested due to automatic review settings March 22, 2026 19:55
@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@gamaware has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f18ae979-2689-46ea-8d29-82f8fb2110f8

📥 Commits

Reviewing files that changed from the base of the PR and between 2f411a5 and 92c63f3.

📒 Files selected for processing (2)
  • .claude/hooks/post-edit.sh
  • CLAUDE.md
📝 Walkthrough

Walkthrough

This pull request introduces shell script validation infrastructure by adding pre-commit hooks (shellcheck and shellharden), refactoring the post-edit hook script to conditionally run fixers based on file extension, updating YAML linting rules, and documenting shell script linting policies.

Changes

Cohort / File(s) Summary
Shell Script Validation
.pre-commit-config.yaml, .claude/hooks/post-edit.sh
Added shellcheck and shellharden pre-commit hooks for shell validation. Refactored post-edit hook to read file path from environment variable and use a case statement to conditionally apply fixers (markdownlint for .md, shellharden and chmod for .sh).
Linting Configuration
.yamllint.yml
Updated YAML linting rules: reduced line-length.max from 200 to 120, disabled truthy key checks (check-keys: false), and changed indentation mode from true to consistent.
Documentation
CLAUDE.md
Added documentation for shell script linting policies (shellcheck/shellharden requirements, variable quoting standards, array usage for word splitting, shebang and executable permission requirements).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 In scripts so fine, let's make them shine,
With shellcheck's eye and hardening line,
From .sh to .md, we lint them all,
Pre-commit hooks answer validation's call,
Better code springs forth, pristine and tall!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the main changes: adding shell hooks (shellcheck/shellharden), updating the post-edit hook pattern, and modifying yamllint configuration.
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
  • Commit unit tests in branch chore/sync-core-infrastructure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR synchronizes repo “core infrastructure” by expanding linting/formatting automation (pre-commit + Claude hook) and aligning YAML lint rules and documentation to the project’s 120-char line-length standard.

Changes:

  • Add local pre-commit hooks for shell script linting/formatting validation (shellcheck + shellharden).
  • Rewrite .claude/hooks/post-edit.sh to format .sh and .md files after edits using a TOOL_INPUT_FILE_PATH-based flow.
  • Update .yamllint.yml defaults (120 max line length, truthy key handling, consistent sequence indentation) and document shell policies in CLAUDE.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
CLAUDE.md Documents the new shell tooling and updates Claude post-edit hook behavior description.
.yamllint.yml Tightens YAML lint configuration (line length, truthy keys, sequence indentation consistency).
.pre-commit-config.yaml Adds shellcheck/shellharden hooks for shell file validation.
.claude/hooks/post-edit.sh Updates post-edit automation to run shellharden/markdownlint and manage exec bit for shebang scripts.

Comment thread .claude/hooks/post-edit.sh Outdated
Comment thread .claude/hooks/post-edit.sh Outdated
Comment thread CLAUDE.md Outdated
@gamaware gamaware merged commit 7327a49 into main Mar 22, 2026
10 checks passed
@gamaware gamaware deleted the chore/sync-core-infrastructure branch March 22, 2026 20:02
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