ArieLevs
## Problem `write_version_to_file()` writes a bare version string for VERSION files (`src/pybump.py:100`): ```python outfile.write(version) ``` No trailing newline. Since the read side at `src/pybump.py:149` uses `stream.read()` with no `strip()`, the newline is simply lost on the round trip. ## Reproduction ``` $ printf '1.0.0\n' > VERSION $ xxd VERSION | tail -1 00000000: 312e 302e 300a 1.0.0. $ pybump bump --level patch --file VERSION 1.0.1 $ xxd VERSION | tail -1 00000000: 312e 302e 31 1.0.1 ``` The trailing `0a` is gone. ## Impact Every bump produces `\ No newline at end of file` in the diff. Most editors and many pre-commit hooks re-add the newline, so the file can then flip back and forth between commits. ## Related: leading/trailing whitespace is not tolerated either `stream.read()` at `src/pybump.py:149` passes the raw file contents straight to `PybumpVersion`. A VERSION file with a blank line at the end fails: ``` $ printf '1.2.3\n\n' > VERSION $ pybump get --file VERSION Invalid semantic version format: 1.2.3 Make sure to comply with https://semver.org/ (lower case 'v' prefix is allowed) ``` A *single* trailing newline works only by accident โ Python's regex `$` matches just before one trailing newline. Two newlines, or a trailing space, and it breaks. ## Suggested fix Two small changes: - `src/pybump.py:149` โ `current_version = stream.read().strip()` - `src/pybump.py:100` โ `outfile.write(version + '\n')` The second is a behaviour change for anyone whose tooling depends on the current no-newline output, so it is worth a deliberate call rather than a silent fix. Preserving whatever the file originally had would avoid that, at the cost of threading the detail through `read_version_from_file()`. Note `test/test_content_files/VERSION` is itself stored without a trailing newline, so it does not currently exercise either case. ๐ค Generated with [Claude Code](https://claude.com/claude-code)