Skip to content

Turn the script into an installable, tested CLI - #1

Open
devnsko wants to merge 1 commit into
mainfrom
claude/cli-project-polish-1lvlbc
Open

Turn the script into an installable, tested CLI#1
devnsko wants to merge 1 commit into
mainfrom
claude/cli-project-polish-1lvlbc

Conversation

@devnsko

Copy link
Copy Markdown
Owner

The tool was a single main.py with a few latent bugs. This reworks it into a
proper package while keeping the same command surface.

Packaging and usability:

  • Add a combinefiles package with a comf console script, so the README's
    hand-rolled .bat/shell wrappers and PATH instructions are no longer needed.
  • Add pyproject.toml (hatchling), ruff and pytest config, and CI across
    Linux/macOS/Windows on Python 3.9 and 3.13.
  • python main.py keeps working as a thin shim.

Behaviour fixes:

  • .gitignore patterns were matched against absolute paths, so they almost never
    matched. They are now matched against repo-relative POSIX paths, with a
    trailing slash for directories, and are applied by default (--no-gitignore
    opts out; the old -g flag is still accepted).
  • requirements.txt was saved as UTF-16, which pip cannot parse. Rewritten UTF-8.
  • Combining twice used to pull the previous combined.md back in as input.
    The output file and leftover combined.* files are now always skipped, and
    --list previews exactly what a real run would include.
  • Binary files were read as text and corrupted the output; they are now
    detected and skipped, along with dotfiles, oversized files and the usual
    noise directories (node_modules, pycache, .venv, ...).
  • Unreadable files and undecodable bytes no longer abort the run.

New options: -a/--all, --hidden, --max-size, --style, -l/--list, -v/--verbose,
-q/--quiet, --version, and -o - to write to stdout. Extensions may be given as
py, .py or *.py. Default output is markdown with fenced, syntax-tagged blocks
whose fences grow when a file contains backticks.

Add 26 tests covering discovery, filtering, output formats and the CLI.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AQMWgFaixEevUt7QnjZv8b

The tool was a single main.py with a few latent bugs. This reworks it into a
proper package while keeping the same command surface.
Packaging and usability:
- Add a `combinefiles` package with a `comf` console script, so the README's
hand-rolled .bat/shell wrappers and PATH instructions are no longer needed.
- Add pyproject.toml (hatchling), ruff and pytest config, and CI across
Linux/macOS/Windows on Python 3.9 and 3.13.
- `python main.py` keeps working as a thin shim.
Behaviour fixes:
- .gitignore patterns were matched against absolute paths, so they almost never
matched. They are now matched against repo-relative POSIX paths, with a
trailing slash for directories, and are applied by default (--no-gitignore
opts out; the old -g flag is still accepted).
- requirements.txt was saved as UTF-16, which pip cannot parse. Rewritten UTF-8.
- Combining twice used to pull the previous combined.md back in as input.
The output file and leftover combined.* files are now always skipped, and
--list previews exactly what a real run would include.
- Binary files were read as text and corrupted the output; they are now
detected and skipped, along with dotfiles, oversized files and the usual
noise directories (node_modules, __pycache__, .venv, ...).
- Unreadable files and undecodable bytes no longer abort the run.
New options: -a/--all, --hidden, --max-size, --style, -l/--list, -v/--verbose,
-q/--quiet, --version, and -o - to write to stdout. Extensions may be given as
py, .py or *.py. Default output is markdown with fenced, syntax-tagged blocks
whose fences grow when a file contains backticks.
Add 26 tests covering discovery, filtering, output formats and the CLI.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQMWgFaixEevUt7QnjZv8b
Sign up for freeto 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

@devnsko@claude