Address code review issues: tests, error handling, naming, config#8
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ValueErrortests totest_lib.py; add invalid-input tests totest_cli.py(exit code non-zero, error message present); 100% branch coveragetry/except ValueError, raisingclick.BadParameterwith a clear messagebin/oct/dec/hex→bin_cmd/oct_cmd/dec_cmd/hex_cmdincli.py; updatepyproject.tomlentry points; enable ruffA001to catch future regressions__init__.py→ relative.libimportclick>=8.0[tool.mypy]section (CI usesty)astral-sh/setup-uv@v6in all three jobsTest plan
uv run pytest --cov=src/convbase --cov-branch— 40 tests pass, 100% coverageuv run ruff check .— no lint errorsuv run ruff format --check .— no format issuesuv run ty check --error-on-warning— no type errorsbin hello→Error: Invalid value for VALUE: invalid integer: 'hello'🤖 Generated with Claude Code