Skip to content

fix(docs): reject a directory argument without --json too - #333

Merged
Jamie-BitFlight merged 1 commit into
mainfrom
claude/fix-315-docs-dir
Oct 9, 2026
Merged

Jamie-BitFlight merged 1 commit into
mainfrom
claude/fix-315-docs-dir

Conversation

@Jamie-BitFlight

Copy link
Copy Markdown
Contributor

Fixes #315.

Before (on main): #330 added the directory check, but only inside the --json branch. Without --json, docs sections <dir>, docs section <dir> H and docs verify <dir> crashed with an IsADirectoryError traceback, exit 1.

After: the existing check runs before the --json branch. Both paths exit 2 with Expected a file path: <dir> on stderr.

Verification:

  • New test test_directory_argument_is_a_usage_error_without_json (3 cases) failed on main and passes on this branch.
  • test_cli_json_contract.py still passes.
  • uv run prek run --all-files: clean.
  • uv run pytest: 2129 passed, 14 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K5rAHJfvZyEEaUQghV7hCQ


Generated by Claude Code

docs sections, section and verify rejected a directory only under --json.
The default path crashed with IsADirectoryError and a traceback. The check
now runs before the --json branch, so both paths exit 2 with the same
'Expected a file path' message.

Fixes #315

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5rAHJfvZyEEaUQghV7hCQ
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b0437d2-3eec-45e4-9ca0-8d52aee6073e

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T11:17:45.335027Z 6cbef82 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 9, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Benchmark Results

🔴 Regression detected — threshold: 30%

scan-clean

Metric Base Compare Change
files_per_second 200.0 files/s 201.7 files/s ✅ +0.8%
scan_max_ms 5322.1 ms 4988.0 ms ✅ -6.3%
scan_mean_ms 5005.7 ms 4963.8 ms ✅ -0.8%
scan_min_ms 4821.2 ms 4947.7 ms ➡️ +2.6%

scan-violations

Metric Base Compare Change
files_per_second 118.9 files/s 118.1 files/s ➡️ -0.7%
scan_max_ms 1726.8 ms 1744.9 ms ➡️ +1.0%
scan_mean_ms 1690.6 ms 1702.3 ms ➡️ +0.7%
scan_min_ms 1664.2 ms 1661.1 ms ✅ -0.2%

fix-violations

Metric Base Compare Change
fix_files_per_second 289.4 files/s 292.2 files/s ✅ +1.0%
fix_max_ms 701.4 ms 693.9 ms ✅ -1.1%
fix_mean_ms 694.5 ms 687.8 ms ✅ -1.0%
fix_min_ms 684.0 ms 684.3 ms ➡️ +0.0%

cpu

Metric Base Compare Change
cpu_clean_mean_ms 0.4 ms 0.3 ms ✅ -12.7%
cpu_fix_mean_ms 1.1 ms 1.0 ms ✅ -10.7%
cpu_violations_mean_ms 0.4 ms 0.4 ms ✅ -9.5%

import

Metric Base Compare Change
import_package_max_ms 178.7 ms 375.4 ms 🔴 +110.1%
import_package_mean_ms 159.9 ms 224.0 ms 🔴 +40.1%
import_package_min_ms 148.6 ms 146.5 ms ✅ -1.4%
import_rules_max_ms 242.7 ms 422.1 ms 🔴 +73.9%
import_rules_mean_ms 241.7 ms 303.0 ms ➡️ +25.4%
import_rules_min_ms 239.7 ms 242.5 ms ➡️ +1.2%

View benchmark history

Updated 2026-10-09 11:17 UTC

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Coverage: 88.40%

📥 Coverage XML available as artifact: coverage-xml

@Jamie-BitFlight
Jamie-BitFlight merged commit 853d131 into main Oct 9, 2026
28 checks passed
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.

docs sections crashes with a traceback when given a directory

2 participants