Skip to content

chore(claude): improve Claude Code integration#540

Merged
nanotaboada merged 2 commits intomasterfrom
chore/claude-code-integration
Mar 25, 2026
Merged

chore(claude): improve Claude Code integration#540
nanotaboada merged 2 commits intomasterfrom
chore/claude-code-integration

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented Mar 24, 2026

Summary

  • Add ## Claude Code section to CLAUDE.md pointing to /precommit
  • Update .claude/settings.json: move model to user-level, normalize
    uv run * permission, remove redundant gh entries (now global)
  • Add .claude/commands/precommit.md with the full pre-commit checklist
    as a /precommit slash command
  • Replace github.copilot-chat with anthropic.claude-code
    in .vscode/extensions.json

Notes

.claude/settings.json and .claude/commands/ are committed intentionally — they contain no secrets and are useful for any contributor using Claude Code. .claude/settings.local.json remains gitignored for machine-specific overrides.

🤖 Generated with Claude Code


This change is Reviewable

Summary by CodeRabbit

  • Chores

    • Updated development configuration and tightened command permissions
    • Swapped VS Code AI extension recommendation from one provider to another
  • Documentation

    • Added a project pre-commit checklist and a new instruction to run the checklist from project guidance

- Add Claude Code section to CLAUDE.md pointing to /precommit
- Update .claude/settings.json: move model to user-level,
  normalize uv run permission, remove redundant gh entries
- Add .claude/commands/precommit.md with full pre-commit checklist
- Replace github.copilot-chat with anthropic.claude-code
  in extensions.json

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Walkthrough

Adds a new pre-commit checklist file and a CLAUDE.md reference to run it, updates .claude/settings.json to remove the model setting and tighten Bash permissions, and swaps VS Code's recommended github.copilot-chat extension for anthropic.claude-code.

Changes

Cohort / File(s) Summary
Pre-commit checklist & docs
​.claude/commands/precommit.md, CLAUDE.md
Added .claude/commands/precommit.md with step-by-step pre-commit checklist (update CHANGELOG.md Unreleased sections; run uv run flake8 ., uv run black --check ., uv run pytest --cov=./ --cov-report=term with coverage ≥ 80%; report results; propose branch name and commit message). Added /precommit reference to CLAUDE.md. Checklist forbids creating branches or committing until explicit confirmation.
Claude settings
​.claude/settings.json
Removed top-level model setting, tightened Bash permission pattern from Bash(uv run:*) to Bash(uv run *), and removed previously allowed Bash permissions for gh issue:* and gh auth:*.
VS Code extensions
.vscode/extensions.json
Replaced recommended extension github.copilot-chat with anthropic.claude-code; updated comment about github.copilot being legacy while leaving unwantedRecommendations entry unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title uses Conventional Commits format (chore) with a specific scope (claude), is descriptive, stays well under 80 characters (46 chars), and directly relates to the main changes in the PR.
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/claude-code-integration
  • 🛠️ sync documentation: Commit on current branch
  • 🛠️ sync documentation: Create PR
  • 🛠️ enforce http error handling: Commit on current branch
  • 🛠️ enforce http error handling: Create PR
  • 🛠️ idiomatic review: Commit on current branch
  • 🛠️ idiomatic review: Create PR
  • 🛠️ verify api contract: Commit on current branch
  • 🛠️ verify api contract: Create PR

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.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cf4b80b) to head (35049d3).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #540   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          113       113           
=========================================
  Hits           113       113           
Components Coverage Δ
Services 100.00% <ø> (ø)
Routes 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.vscode/extensions.json (1)

46-50: ⚠️ Potential issue | 🟡 Minor

Stale comment after removing github.copilot-chat.

The comment on line 49 states "Unified into copilot-chat", but github.copilot-chat was removed from recommendations in favor of anthropic.claude-code. Consider updating this comment to reflect the current setup.

📝 Suggested fix
   "unwantedRecommendations": [
     "ms-azuretools.vscode-docker",       // Docker (legacy) - Use vscode-containers instead
     "docker.docker",                     // Docker DX - Use ms-azuretools.vscode-containers
-    "github.copilot"                     // Copilot (base) - Unified into copilot-chat
+    "github.copilot",                    // Copilot (base) - Use anthropic.claude-code instead
+    "github.copilot-chat"                // Copilot Chat - Use anthropic.claude-code instead
   ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vscode/extensions.json around lines 46 - 50, Update the stale inline
comment next to the "github.copilot" entry in the unwantedRecommendations array:
replace or remove the text "Unified into copilot-chat" so it reflects the
current replacement (e.g., mention that copilot was replaced by
"anthropic.claude-code") or simply remove the outdated remark; locate the
"unwantedRecommendations" array and the "github.copilot" entry in the file to
make the change.
🧹 Nitpick comments (1)
.claude/commands/precommit.md (1)

6-7: Running pytest twice is redundant.

Steps 4 and 5 both invoke pytest—step 4 runs tests without coverage, then step 5 re-runs with coverage. Consider combining them into a single command to save time.

♻️ Suggested consolidation
-4. Run `uv run pytest` — all tests must pass.
-5. Run `uv run pytest --cov=./ --cov-report=term` — coverage must be ≥80%.
+4. Run `uv run pytest --cov=./ --cov-report=term` — all tests must pass and coverage must be ≥80%.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/precommit.md around lines 6 - 7, Replace the redundant
two-step test instructions that run "uv run pytest" and then "uv run pytest
--cov=./ --cov-report=term" with a single step that runs pytest once with
coverage (e.g., "uv run pytest --cov=./ --cov-report=term" and any required
flags) so tests are executed only once while collecting coverage; update the
list to remove the standalone "uv run pytest" entry and ensure the single
command enforces the ≥80% coverage requirement.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/commands/precommit.md:
- Around line 4-5: Update the flake8 exclusions to match Black's excludes so
both linters operate on the same file set: modify the .flake8 configuration (the
Exclude setting) to include the same patterns used by Black in pyproject.toml
(rest/, scripts/, tools/, storage/) and explicitly exclude tests/test_main.py
(or add a consistent per-file-ignores entry) so flake8 no longer checks files
Black skips; ensure you edit the .flake8 Exclude and any per-file-ignores to
align with the pyproject.toml Black exclude entries.

---

Outside diff comments:
In @.vscode/extensions.json:
- Around line 46-50: Update the stale inline comment next to the
"github.copilot" entry in the unwantedRecommendations array: replace or remove
the text "Unified into copilot-chat" so it reflects the current replacement
(e.g., mention that copilot was replaced by "anthropic.claude-code") or simply
remove the outdated remark; locate the "unwantedRecommendations" array and the
"github.copilot" entry in the file to make the change.

---

Nitpick comments:
In @.claude/commands/precommit.md:
- Around line 6-7: Replace the redundant two-step test instructions that run "uv
run pytest" and then "uv run pytest --cov=./ --cov-report=term" with a single
step that runs pytest once with coverage (e.g., "uv run pytest --cov=./
--cov-report=term" and any required flags) so tests are executed only once while
collecting coverage; update the list to remove the standalone "uv run pytest"
entry and ensure the single command enforces the ≥80% coverage requirement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 461e913f-2e1c-4ef5-952c-da3ced9b08d5

📥 Commits

Reviewing files that changed from the base of the PR and between cf4b80b and 07a5c0b.

📒 Files selected for processing (4)
  • .claude/commands/precommit.md
  • .claude/settings.json
  • .vscode/extensions.json
  • CLAUDE.md

Comment on lines +4 to +5
2. Run `uv run flake8 .` — must pass.
3. Run `uv run black --check .` — must pass (run `uv run black .` to auto-fix).
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the directories excluded by Black but not by flake8 exist
echo "Checking for directories excluded by Black but not flake8:"
for dir in rest scripts tools storage; do
  if [ -d "$dir" ]; then
    echo "  $dir/ exists - may cause linter inconsistency"
  else
    echo "  $dir/ does not exist"
  fi
done

Repository: nanotaboada/python-samples-fastapi-restful

Length of output: 343


🏁 Script executed:

#!/bin/bash
# Check the actual .flake8 configuration
echo "=== .flake8 configuration ==="
if [ -f ".flake8" ]; then
  cat ".flake8"
else
  echo ".flake8 file not found"
fi

echo ""
echo "=== pyproject.toml Black configuration ==="
if [ -f "pyproject.toml" ]; then
  grep -A 10 "\[tool.black\]" pyproject.toml
else
  echo "pyproject.toml file not found"
fi

Repository: nanotaboada/python-samples-fastapi-restful

Length of output: 536


🏁 Script executed:

#!/bin/bash
# Get the full Black configuration section
echo "=== Full pyproject.toml [tool.black] section ==="
if [ -f "pyproject.toml" ]; then
  sed -n '/\[tool.black\]/,/^\[/p' pyproject.toml | head -n -1
else
  echo "pyproject.toml file not found"
fi

Repository: nanotaboada/python-samples-fastapi-restful

Length of output: 403


Fix linter exclusion inconsistency between flake8 and Black.

The .flake8 configuration only excludes .venv, while pyproject.toml configures Black to exclude rest/, scripts/, tools/, storage/, and tests/test_main.py. This creates a mismatch: flake8 will check files that Black intentionally skips, potentially causing spurious failures in the pre-commit checklist.

Additionally, tests/test_main.py is treated inconsistently—Black excludes it entirely, but flake8 checks it (ignoring only E501 via per-file-ignores). Align .flake8 exclusions with Black's configuration to ensure consistent linting behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/precommit.md around lines 4 - 5, Update the flake8
exclusions to match Black's excludes so both linters operate on the same file
set: modify the .flake8 configuration (the Exclude setting) to include the same
patterns used by Black in pyproject.toml (rest/, scripts/, tools/, storage/) and
explicitly exclude tests/test_main.py (or add a consistent per-file-ignores
entry) so flake8 no longer checks files Black skips; ensure you edit the .flake8
Exclude and any per-file-ignores to align with the pyproject.toml Black exclude
entries.

- Remove redundant pytest step; coverage run executes tests
- Update github.copilot unwanted comment to reflect current state

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

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.

🧹 Nitpick comments (1)
.claude/commands/precommit.md (1)

1-1: Consider adding a top-level markdown heading.

While this command file is functional as-is, standard markdown practice recommends starting with a heading. This would improve readability and satisfy markdownlint.

📝 Optional heading addition
+# Pre-commit Checklist
+
 Run the pre-commit checklist for this project:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/precommit.md at line 1, Add a top-level Markdown heading to
the precommit.md command document to satisfy markdownlint and improve
readability; edit the precommit.md file and insert a single H1 (e.g., "#
Pre-commit Checklist" or similar) at the very top of the file so the file begins
with that heading before the existing content.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.claude/commands/precommit.md:
- Line 1: Add a top-level Markdown heading to the precommit.md command document
to satisfy markdownlint and improve readability; edit the precommit.md file and
insert a single H1 (e.g., "# Pre-commit Checklist" or similar) at the very top
of the file so the file begins with that heading before the existing content.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12f9adcb-1378-4a85-9e47-938286aa37b3

📥 Commits

Reviewing files that changed from the base of the PR and between 07a5c0b and 35049d3.

📒 Files selected for processing (2)
  • .claude/commands/precommit.md
  • .vscode/extensions.json
✅ Files skipped from review due to trivial changes (1)
  • .vscode/extensions.json

@nanotaboada nanotaboada merged commit df451ad into master Mar 25, 2026
13 checks passed
@nanotaboada nanotaboada deleted the chore/claude-code-integration branch March 25, 2026 00:57
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.

1 participant