Skip to content

docs: add AI Coding Guide for cpp-linter-hooks#172

Merged
shenxianpeng merged 1 commit intomainfrom
feature/create-instructions
Feb 16, 2026
Merged

docs: add AI Coding Guide for cpp-linter-hooks#172
shenxianpeng merged 1 commit intomainfrom
feature/create-instructions

Conversation

@shenxianpeng
Copy link
Collaborator

@shenxianpeng shenxianpeng commented Feb 16, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive developer guide covering project overview, architectural flow patterns, core module organization, version management practices, and development workflows. Provides detailed guidance on local testing, feature additions, dependency management conventions, testing standards, argument handling, critical files, integration points with package management and framework configurations, and common debugging and extension tasks.

@shenxianpeng shenxianpeng added the developer Changes that impact developers label Feb 16, 2026
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 16, 2026
@sonarqubecloud
Copy link

@shenxianpeng shenxianpeng removed documentation Improvements or additions to documentation enhancement New feature or request labels Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.41%. Comparing base (ff7b30c) to head (d20c363).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   95.41%   95.41%           
=======================================
  Files           4        4           
  Lines         109      109           
=======================================
  Hits          104      104           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Walkthrough

Adds a new Markdown documentation file at .github/copilot-instructions.md that provides comprehensive guidance on the cpp-linter-hooks project structure, including architecture overview, module descriptions, development workflows, conventions, and integration patterns.

Changes

Cohort / File(s) Summary
Documentation
.github/copilot-instructions.md
New comprehensive guide covering cpp-linter-hooks project architecture, core modules (clang_format.py, clang_tidy.py, util.py, versions.py), development workflows, version management, testing conventions, dependency management, integration points, and common maintenance tasks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (1 file):

⚔️ .github/workflows/codspeed.yml (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add AI Coding Guide for cpp-linter-hooks' accurately reflects the main change: adding a documentation file (.github/copilot-instructions.md) that serves as an AI coding guide for the cpp-linter-hooks project.
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 feature/create-instructions
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feature/create-instructions
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

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
Before applying any fix, first verify the finding against the current code and
decide whether a code change is actually needed. If the finding is not valid or
no change is required, do not modify code for that item and briefly explain why
it was skipped.

In @.github/copilot-instructions.md:
- Around line 35-36: The two pre-commit try-repo commands use the wrong
repository path (`./..`) and should point to the current repo; update the lines
containing "pre-commit try-repo ./.. clang-format --verbose --all-files" and
"pre-commit try-repo ./.. clang-tidy --verbose --all-files" to use a single dot
instead: "pre-commit try-repo . clang-format --verbose --all-files" and
"pre-commit try-repo . clang-tidy --verbose --all-files".
- Around line 1-113: Add a brief "Getting Started" section at the top with quick
steps to run and test the hooks (installation, example commands like pre-commit
try-repo and uv run pytest), a "Troubleshooting" section listing common failures
and fixes (pip install issues, version resolution, verbose flags), and an
"External Links" subsection linking to pre-commit, clang-format, and clang-tidy
docs plus a short "Version History / Changelog" pointer (or link) for updates;
place these new headings in the existing guide near the top so they are
prominent and update the README/examples references under "Development
Workflows" to point to the new Getting Started and Troubleshooting sections.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Before applying any fix, first verify the finding against the current code and
decide whether a code change is actually needed. If the finding is not valid or
no change is required, do not modify code for that item and briefly explain why
it was skipped.

In @.github/copilot-instructions.md:
- Around line 1-113: Add a brief "Getting Started" section at the top with quick
steps to run and test the hooks (installation, example commands like pre-commit
try-repo and uv run pytest), a "Troubleshooting" section listing common failures
and fixes (pip install issues, version resolution, verbose flags), and an
"External Links" subsection linking to pre-commit, clang-format, and clang-tidy
docs plus a short "Version History / Changelog" pointer (or link) for updates;
place these new headings in the existing guide near the top so they are
prominent and update the README/examples references under "Development
Workflows" to point to the new Getting Started and Troubleshooting sections.
.github/copilot-instructions.md (1)

1-113: Documentation quality: well-structured and comprehensive.

This AI Coding Guide is well-organized and provides valuable context for developers and AI assistants working on the project. The structure covers all essential aspects: architecture, workflows, conventions, and common tasks.

Consider adding:

  • A "Getting Started" section at the beginning for new contributors
  • A troubleshooting section for common issues
  • Links to external resources (pre-commit docs, clang-format/clang-tidy docs)
  • Version history or changelog reference
🤖 Prompt for AI Agents
Before applying any fix, first verify the finding against the current code and
decide whether a code change is actually needed. If the finding is not valid or
no change is required, do not modify code for that item and briefly explain why
it was skipped.
In @.github/copilot-instructions.md around lines 1 - 113, Add a brief "Getting
Started" section at the top with quick steps to run and test the hooks
(installation, example commands like pre-commit try-repo and uv run pytest), a
"Troubleshooting" section listing common failures and fixes (pip install issues,
version resolution, verbose flags), and an "External Links" subsection linking
to pre-commit, clang-format, and clang-tidy docs plus a short "Version History /
Changelog" pointer (or link) for updates; place these new headings in the
existing guide near the top so they are prominent and update the README/examples
references under "Development Workflows" to point to the new Getting Started and
Troubleshooting sections.

Comment on lines +35 to +36
pre-commit try-repo ./.. clang-format --verbose --all-files
pre-commit try-repo ./.. clang-tidy --verbose --all-files
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Read the copilot-instructions.md file to see the context around lines 35-36
head -n 60 .github/copilot-instructions.md | tail -n 30

Repository: cpp-linter/cpp-linter-hooks

Length of output: 1223


🏁 Script executed:

# Search for any other pre-commit try-repo usage in the repository
rg -n 'try-repo' --type md --type sh --type yaml --type yml

Repository: cpp-linter/cpp-linter-hooks

Length of output: 98


🏁 Script executed:

# Check if there are any GitHub Actions workflows that use pre-commit
find .github -name "*.yaml" -o -name "*.yml" | head -20

Repository: cpp-linter/cpp-linter-hooks

Length of output: 405


🏁 Script executed:

# Read the pre-commit workflow file to see how try-repo is used there
cat .github/workflows/pre-commit.yml

Repository: cpp-linter/cpp-linter-hooks

Length of output: 314


🌐 Web query:

pre-commit try-repo documentation syntax path argument

💡 Result:

pre-commit try-repo syntax is:

pre-commit try-repo [options] repo [hook]
  • repo is the “Repository to source hooks from” (positional argument). It can be a git repo URL or a local filesystem path to a repo checkout (for example: ../path/to/my-hooks). [1][2]
  • hook (optional) is a single hook id to run; if omitted, it will generate a config snippet / run the repo’s hooks per your selection. [1]
  • To try a specific revision, use --ref / --rev; if you don’t specify it, try-repo uses the repo’s HEAD. [1]

Example with a local path:

pre-commit try-repo ../LOCAL/PATH/TO/my-hooks

[2]

Example with a remote + ref:

pre-commit try-repo --ref v4.0.0 https://github.com/pre-commit/pre-commit-hooks trailing-whitespace

[1]

Sources: [1] https://www.mankier.com/1/pre-commit-try-repo [2] https://blog.dagworks.io/p/custom-pre-commit-hooks-for-safer


🏁 Script executed:

# Search for any setup.py, pyproject.toml, or README that might document this
rg -n 'try-repo' -type md -A 2 -B 2

Repository: cpp-linter/cpp-linter-hooks

Length of output: 98


🏁 Script executed:

# Check if there's any documentation about where to run pre-commit commands from
rg -n 'pre-commit' README.md -A 2 -B 2 | head -50

Repository: cpp-linter/cpp-linter-hooks

Length of output: 1281


🏁 Script executed:

# Check pyproject.toml or tox.ini for pre-commit usage patterns
fd -e toml -e ini | xargs grep -l 'pre-commit' 2>/dev/null

Repository: cpp-linter/cpp-linter-hooks

Length of output: 85


🏁 Script executed:

# Check pyproject.toml for pre-commit related configurations
grep -n 'pre-commit' pyproject.toml -A 5 -B 5

Repository: cpp-linter/cpp-linter-hooks

Length of output: 695


🏁 Script executed:

# Let me also check what the actual repository root structure looks like
# and understand where commands would typically be run from
ls -la | head -20

Repository: cpp-linter/cpp-linter-hooks

Length of output: 1225


Fix pre-commit try-repo path from ./.. to .

Lines 35-36 use ./.. as the repository path, which resolves to the parent directory rather than the current repository. When running these commands from the repository root (as the documentation context indicates), the path should be . instead:

Suggested fix
- pre-commit try-repo ./.. clang-format --verbose --all-files
- pre-commit try-repo ./.. clang-tidy --verbose --all-files
+ pre-commit try-repo . clang-format --verbose --all-files
+ pre-commit try-repo . clang-tidy --verbose --all-files
📝 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
pre-commit try-repo ./.. clang-format --verbose --all-files
pre-commit try-repo ./.. clang-tidy --verbose --all-files
pre-commit try-repo . clang-format --verbose --all-files
pre-commit try-repo . clang-tidy --verbose --all-files
🤖 Prompt for AI Agents
Before applying any fix, first verify the finding against the current code and
decide whether a code change is actually needed. If the finding is not valid or
no change is required, do not modify code for that item and briefly explain why
it was skipped.
In @.github/copilot-instructions.md around lines 35 - 36, The two pre-commit
try-repo commands use the wrong repository path (`./..`) and should point to the
current repo; update the lines containing "pre-commit try-repo ./.. clang-format
--verbose --all-files" and "pre-commit try-repo ./.. clang-tidy --verbose
--all-files" to use a single dot instead: "pre-commit try-repo . clang-format
--verbose --all-files" and "pre-commit try-repo . clang-tidy --verbose
--all-files".

@shenxianpeng shenxianpeng merged commit edd37f1 into main Feb 16, 2026
19 checks passed
@shenxianpeng shenxianpeng deleted the feature/create-instructions branch February 16, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

developer Changes that impact developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant