Skip to content

Claude/prepare v0.2.0a3#6

Merged
0-k merged 12 commits into
masterfrom
claude/prepare-v0.2.0a3-housekeeping-01NcWNG8F5nA9n44HnZUUMCm
Nov 15, 2025
Merged

Claude/prepare v0.2.0a3#6
0-k merged 12 commits into
masterfrom
claude/prepare-v0.2.0a3-housekeeping-01NcWNG8F5nA9n44HnZUUMCm

Conversation

@0-k
Copy link
Copy Markdown
Owner

@0-k 0-k commented Nov 15, 2025

No description provided.

- Switch from Black/Flake8/isort to Ruff for faster linting and formatting
  - Add Ruff configuration to pyproject.toml
  - Update CI workflow to use ruff check and ruff format
  - Update requirements-dev.txt (removed black, isort, twine)

- Completely redesign README.md for better usability
  - Add comprehensive feature list with visual indicators
  - Add installation and quick start sections
  - Add configuration reference table
  - Add development setup instructions
  - Update badge from Black to Ruff

- Update CLAUDE.md project documentation
  - Reflect completed tasks (ReadTheDocs, const.py refactor, pytest migration, ruff)
  - Update project structure to show data/ directory
  - Update all code style references from Black/Flake8 to Ruff
  - Update Tax Year Support Matrix (2023-2025 now fully supported)
  - Update version to 1.1

- Bump version to 0.2.0a3 in pyproject.toml
- Add comprehensive changelog entry for v0.2.0a3
- Fix import sorting across all modules
- Modernize type hints (Dict -> dict, List -> list, Optional[X] -> X | None)
- Remove unused imports
- Fix type comparison to use 'is' instead of '==' for NotImplementedError
- Auto-format all Python files with ruff

All ruff checks now pass successfully.
- Add .pre-commit-config.yaml with ruff hooks
  - Automatically runs ruff check --fix before commits
  - Automatically runs ruff format before commits
  - Prevents CI failures by catching issues locally

- Add pre-commit to requirements-dev.txt

- Update documentation (README.md and CLAUDE.md)
  - Add pre-commit installation instructions to setup
  - Document pre-commit usage in Git Workflow section
  - Emphasize importance for preventing CI failures

- Update CHANGELOG.md with pre-commit addition

This addresses the issue where code quality checks were failing in CI.
Pre-commit hooks now catch formatting and linting issues before they
are committed, ensuring all commits pass CI checks.
- Update isinstance calls to use `int | float` instead of `(int, float)`
- Applies Python 3.10+ union type syntax in isinstance checks
- Ensures all pre-commit hooks pass

These were unsafe fixes that required manual application.
All code quality checks now pass locally and should pass in CI.
Add --unsafe-fixes flag to ruff pre-commit hook to automatically
apply all available fixes, including modern Python syntax updates
like `int | float` instead of `(int, float)` in isinstance calls.

This ensures maximum code modernization and prevents manual fixes.
- Update pyproject.toml to use line-length = 88
- Reformat all code with new 88-character line limit
- Update CLAUDE.md to reflect new line length setting
- Update CHANGELOG.md to document the change

Rationale:
- 88 is Black's default and widely adopted in Python community
- Better for code review (fits in GitHub PR split views)
- More readable on various screen sizes
- Encourages cleaner, more focused code
- Aligns with PEP 8 recommendations (up to 99 is acceptable)

This is a one-time formatting change that establishes a consistent
standard for all future contributions.
Reduce documentation fluff by removing:
- Redundant "Validate with pydantic" comments in data_loader.py
- Redundant "Skip missing years" comments in data_loader.py
- One-liner class docstrings that just restate the class name
- Verbose parameter descriptions that just repeat defaults
- Explanatory comments in docstring examples
- Obvious inline comments (e.g., "Calculate the gradient..." in __calc_gradient)

Simplify docstrings by:
- Converting verbose example comments to concise >>> format
- Removing redundant "or int" type annotations
- Shortening parameter descriptions to essentials
- Removing return value names (use just the type)
- Fixing outdated references (const.py -> JSON files)

All code quality checks pass. Documentation is now more concise
while retaining essential information.
Add explicit instructions to install package in editable mode before
running pytest. This fixes the common 'ModuleNotFoundError: No module
named netto' error when running tests.

Changes:
- Add pip install -e . as first step in test running instructions
- Note that this is required for imports to work
- Mention --import-mode=append alternative (used by CI)
- Update both README.md and CLAUDE.md for consistency
Change pytest commands from bare 'pytest' to 'python -m pytest' to
avoid issues with UV and other tool managers that isolate pytest in
a separate environment.

This ensures pytest runs in the same Python environment where the
netto package is installed, preventing ModuleNotFoundError.

Tested locally - all 194 tests pass with python -m pytest.
Add 'Advanced: Using Helper Functions' section demonstrating:
- calc_deductible_social_security()
- calc_taxable_income()
- get_marginal_tax_rate()

Shows how users can access intermediate calculations for more
granular control over the tax calculation pipeline.
- README.md: Rename deductible_ss to deductible_social_security for clarity
- CLAUDE.md: Add v0.3.0 API improvement proposal
  - Overloaded parameters for helper functions (salary OR taxable_income)
  - Eliminates redundant parameter passing
  - Implementation example and rationale documented
@0-k 0-k merged commit bbb4da8 into master Nov 15, 2025
6 checks passed
@0-k 0-k deleted the claude/prepare-v0.2.0a3-housekeeping-01NcWNG8F5nA9n44HnZUUMCm branch November 25, 2025 20:08
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.

2 participants