Fix bugs from code review, add CI and __all__#4
Merged
Conversation
Bug fixes in arbol.py:
- Fix end parameter double-application in aprint (e.g. end='!!' produced '!!!!')
- Fix KeyboardInterrupt/SystemExit leaking _depth (except Exception -> BaseException)
- Fix elapsed time silent drop for durations >= 24 hours (added days case)
- Fix section decorator losing function metadata (added functools.wraps)
- Fix flush parameter silently ignored in tree mode (plumbed through native_print)
- Fix set_log_max_depth docstring inaccuracy ("clamped to minimum of 1")
- Fix Makefile publish grep prefix-matching edge case (anchor with $)
Additions:
- Add __all__ to __init__.py for explicit public API
- Add .github/workflows/test.yml (pytest across Python 3.9-3.13 + ruff lint)
- Add test gate in publish.yml (build now requires tests to pass)
Housekeeping:
- Fix stale test comments in test_arbol.py
- Update CLAUDE.md line count (285 -> 390)
Co-Authored-By: Claude Opus 4.6 (1M context) <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
endparameter double-application inaprint— e.g.aprint('hi', end='!!')producedhi!!!!instead ofhi!!. Was masked for the defaultend='\n'becausesplit('\n')consumed the trailing newline.KeyboardInterrupt/SystemExitleaking_depth— changedexcept Exceptiontoexcept BaseExceptioninasectionso Ctrl-C no longer permanently corrupts the depth counter.elseclause to_print_elapsedformatting as days.sectiondecorator losing function metadata — added@functools.wraps.flushparameter silently ignored in tree mode — plumbed throughnative_print.set_log_max_depthdocstring — said "clamped to minimum of 1" but actually clamps to 0.publishgrep prefix-matching —2026.2.2no longer falsely matches2026.2.22.__all__to__init__.pyfor explicit public API.test.yml) — pytest across Python 3.9–3.13 + ruff lint/format check on push/PR.publish.yml— build now requires tests to pass before publishing.Test plan
end/sep/flush,__all__, Makefile grep compatibility🤖 Generated with Claude Code