Skip to content

Address code review issues: tests, error handling, naming, config#8

Merged
jkomalley merged 1 commit into
mainfrom
feature/code-review-improvements
Mar 7, 2026
Merged

Address code review issues: tests, error handling, naming, config#8
jkomalley merged 1 commit into
mainfrom
feature/code-review-improvements

Conversation

@jkomalley

Copy link
Copy Markdown
Owner

Summary

  • Tests: Add ValueError tests to test_lib.py; add invalid-input tests to test_cli.py (exit code non-zero, error message present); 100% branch coverage
  • Error handling: Wrap each CLI command in try/except ValueError, raising click.BadParameter with a clear message
  • Built-in shadowing: Rename bin/oct/dec/hexbin_cmd/oct_cmd/dec_cmd/hex_cmd in cli.py; update pyproject.toml entry points; enable ruff A001 to catch future regressions
  • Import: Fix absolute import in __init__.py → relative .lib import
  • Dependency: Pin click>=8.0
  • Config: Remove dead [tool.mypy] section (CI uses ty)
  • CI: Replace curl-based uv install with astral-sh/setup-uv@v6 in all three jobs

Test plan

  • uv run pytest --cov=src/convbase --cov-branch — 40 tests pass, 100% coverage
  • uv run ruff check . — no lint errors
  • uv run ruff format --check . — no format issues
  • uv run ty check --error-on-warning — no type errors
  • bin helloError: Invalid value for VALUE: invalid integer: 'hello'

🤖 Generated with Claude Code

- Add ValueError tests to test_lib.py and invalid-input tests to test_cli.py
- Wrap CLI commands in try/except ValueError, raising click.BadParameter
- Rename cli functions bin/oct/dec/hex → bin_cmd/oct_cmd/dec_cmd/hex_cmd to avoid shadowing built-ins; update pyproject.toml entry points
- Enable ruff A001 lint rule to catch future built-in shadowing
- Fix absolute import in __init__.py to use relative import
- Pin click>=8.0 dependency
- Remove dead [tool.mypy] config section
- Replace curl-based uv install in CI with astral-sh/setup-uv@v6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jkomalley jkomalley merged commit d352dcc into main Mar 7, 2026
7 checks passed
@jkomalley jkomalley deleted the feature/code-review-improvements branch March 7, 2026 03:41
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