Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Jan 18, 2026

Summary

  • Replace external sphinx-argparse dependency with custom sphinx_argparse_neo extensions
  • Add colored CLI help output with syntax-highlighted examples
  • Add PEP 561 py.typed marker for type checker support
  • Port Sphinx extensions from vcspull project with full test coverage

Changes

CLI Enhancements

  • Add _colors.py module for ANSI color support with auto-detection
  • Add _formatter.py with ColoredHelpFormatter for rich help output
  • Add CLI examples to --help for info and reverse commands

Documentation Extensions

  • Add docs/_ext/sphinx_argparse_neo/ module
  • Add docs/_ext/argparse_exemplar.py extension
  • Add syntax highlighting lexers and roles
  • Add CSS for argparse syntax highlighting
  • Remove sphinx-argparse from dependencies

Type Safety

  • Add py.typed marker to cihai_cli package
  • Enable mypy checking for docs/_ext/
  • Add types-docutils and types-Pygments stubs

Tests

  • Add comprehensive test suite for Sphinx extensions
  • Add integration tests for CLI help examples

Test plan

  • uv run ruff check . passes
  • uv run ruff format . passes
  • uv run mypy passes (21 source files)
  • uv run pytest --reruns 0 passes (365 tests)
  • sphinx-build -b html docs docs/_build/html builds successfully

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 88.33853% with 299 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.16%. Comparing base (785842c) to head (7f71629).
⚠️ Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
docs/_ext/argparse_exemplar.py 54.31% 143 Missing ⚠️
docs/_ext/sphinx_argparse_neo/nodes.py 50.79% 62 Missing ⚠️
docs/_ext/sphinx_argparse_neo/directive.py 21.73% 54 Missing ⚠️
docs/_ext/sphinx_argparse_neo/__init__.py 36.84% 12 Missing ⚠️
docs/_ext/sphinx_argparse_neo/renderer.py 92.42% 10 Missing ⚠️
src/cihai_cli/_formatter.py 95.00% 4 Missing ⚠️
tests/docs/_ext/test_argparse_exemplar.py 98.76% 4 Missing ⚠️
docs/_ext/sphinx_argparse_neo/compat.py 95.45% 2 Missing ⚠️
docs/_ext/sphinx_argparse_neo/parser.py 98.68% 2 Missing ⚠️
src/cihai_cli/_colors.py 94.11% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #337       +/-   ##
===========================================
+ Coverage   75.76%   87.16%   +11.39%     
===========================================
  Files           5       30       +25     
  Lines         260     2821     +2561     
===========================================
+ Hits          197     2459     +2262     
- Misses         63      362      +299     

☔ 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.

@tony tony marked this pull request as ready for review January 18, 2026 19:14
@tony
Copy link
Member Author

tony commented Jan 18, 2026

Code review

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

🤖 Generated with Claude Code

@tony tony force-pushed the cli-and-docs-our-argparse branch from 16ce786 to 5b20ba8 Compare January 24, 2026 13:03
@tony
Copy link
Member Author

tony commented Jan 24, 2026

Code review

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

🤖 Generated with Claude Code

tony added a commit that referenced this pull request Jan 24, 2026
why: CHANGES file was missing documentation for the major features in PR #337.

what:
- Add colored CLI help output under What's new
- Add py.typed marker under Packaging
- Add sphinx_argparse_neo replacement under Development
- Add dev dependencies (types-docutils, types-Pygments)
@tony
Copy link
Member Author

tony commented Jan 24, 2026

Code review

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

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@tony tony force-pushed the cli-and-docs-our-argparse branch from c7a2025 to 9b56918 Compare January 24, 2026 18:51
@tony
Copy link
Member Author

tony commented Jan 24, 2026

Code review

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

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@tony tony force-pushed the cli-and-docs-our-argparse branch from 987c8ad to 4f7062a Compare January 24, 2026 19:13
@tony
Copy link
Member Author

tony commented Jan 24, 2026

Code review

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

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@tony tony force-pushed the cli-and-docs-our-argparse branch from 4f7062a to b4c45b3 Compare January 24, 2026 20:22
@tony tony force-pushed the cli-and-docs-our-argparse branch from b4c45b3 to ade42a8 Compare January 24, 2026 21:12
@tony
Copy link
Member Author

tony commented Jan 24, 2026

Code review

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

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

tony added 3 commits January 24, 2026 15:52
why: cihai_cli is the project's own package with py.typed marker
what:
- Remove cihai_cli and cihai_cli.* from mypy override
- Keep only external dependency cihai.* in ignore_missing_imports
why: Copy-paste remnant referenced vcspull instead of cihai-cli
what:
- Update docstring to reference cihai-cli documentation
Add consistent styling to pre.argparse-usage to match code blocks:
- background: #272822 (Monokai, same as .highlight)
- padding, line-height, border-radius
- thin scrollbars using Furo CSS variable
@tony tony changed the title docs: Replace sphinx-argparse with sphinx_argparse_neo feat: Colored CLI help, sphinx_argparse_neo extensions, py.typed marker Jan 24, 2026
@tony tony changed the title feat: Colored CLI help, sphinx_argparse_neo extensions, py.typed marker feat: Colored CLI help, sphinx_argparse_neo extension Jan 24, 2026
@tony tony merged commit 14a16ba into master Jan 24, 2026
10 of 11 checks passed
@tony tony deleted the cli-and-docs-our-argparse branch January 24, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants