bfiles
2025-04-30
Major rewrite of CLI, core bundling engine, exclusion system, and output modules
18 files · 2,767+ · 445-
CLI overhaul
1 file changed
cli.pyFully-featured Click command with --version, --log-level, --no-gitignore, --max-files, --exclusion-report; structured error handling with exit codes; BfilesConfig integration
- Replaced simple flat CLI with a fully-featured Click command including
--version,--log-level,--no-gitignore,--max-files, and--exclusion-reportoptions baseline behavioral1 file
cli.py
- Added structured error handling with specific exit codes (0 for success, 1 for general errors, 2 for missing dependencies)
remediate
internal
1 file
cli.py
- CLI now creates a
BfilesConfiginstance and passes it tobundle_files()decouple behavioral1 file
cli.py
- Added dynamic version detection via
importlib.metadatabaseline internal1 file
cli.py
Core bundling engine rewrite
1 file changed
core.pyComplete rewrite from ~90 to ~460 lines; multi-phase architecture with bundle header/footer, timestamp, statistics tracking, and ExclusionManager return
- Complete rewrite from ~90 lines to ~460 lines with a multi-phase architecture:
decouple
architectural
1 file
core.py
- Added bundle header/footer writing with timestamp and config metadata
baseline
internal
1 file
core.py
- Returns
ExclusionManagerinstance for post-processing report generation decouple internal1 file
core.py
- Tracks detailed statistics: processed files, included files, duplicates, empty files, IO errors, encoding errors
decouple
internal
1 file
core.py
Exclusion system expansion
1 file changed
exclusions.pyMassively expanded from ~63 to ~505 lines; gitignore integration via pathspec; ExclusionReason enum; exclusion report generation; pattern validation
- Massively expanded from ~63 lines to ~505 lines
decouple
internal
1 file
exclusions.py
- Added
.gitignoreintegration viapathspeclibrary with hierarchical gitignore loading instantiate internal1 file
exclusions.py
- Introduced
ExclusionReasonenum for typed exclusion tracking decouple internal1 file
exclusions.py
- Added exclusion report generation to file
instantiate
internal
1 file
exclusions.py
- Pattern validation and logging for invalid regex patterns
remediate
behavioral
1 file
exclusions.py
Configuration modernization
1 file changed
config.pyExpanded BfilesConfig with use_gitignore, hash_algorithm, log_verbosity; ExcludePattern type alias; DEFAULT_OUTPUT_FILENAME constant
- Expanded
BfilesConfigwithuse_gitignore,hash_algorithm, andlog_verbositysettings baseline internal1 file
config.py
- Added
ExcludePatterntype alias and_get_default_exclude_patterns()factory function instantiate internal1 file
config.py
- Default output filename now configurable via
DEFAULT_OUTPUT_FILENAMEconstant decouple behavioral1 file
config.py
Output and display
1 file changed
output.pyExpanded from simple table helper to full summary table display, text summary generation, and rich terminal file operation status indicators
- Expanded from simple table helper to full summary table display and text summary generation
decouple
behavioral
1 file
output.py
- Rich terminal output with file operation status indicators
decouple
behavioral
1 file
output.py
Package init
1 file changed
__init__.pyProper __all__ exports for BfilesConfig, bundle_files, and logger
- Added proper
__all__exports forBfilesConfig,bundle_files, andloggerinstantiate internal1 file
__init__.py
Metadata improvements
2 files changed
metadata.pyFileMetadata enhanced with operation field tracking file state (included, excluded, skipped, error)metadata_writer.pyMetadataWriter now accepts BfilesConfig for template-driven output
FileMetadataenhanced withoperationfield for tracking file state (included, excluded, skipped, error) decouple internal1 file
metadata.py
MetadataWriternow acceptsBfilesConfigfor template-driven output decouple behavioral1 file
metadata_writer.py
Infrastructure
4 files changed
.gitignoreReplaced with comprehensive generated version covering Python, macOS, editors, Terraform, and moreenv.shEnvironment setup script addedpyproject.tomlUpdated with new dependenciestest_cli.pyRemoved old basic CLI tests (17 lines)
- Replaced comprehensive
.gitignorewith a thorough generated version covering Python, macOS, editors, Terraform, and more baseline internal1 file
.gitignore
- Added
env.shenvironment setup script baseline internal1 file
env.sh
- Updated
pyproject.tomlwith new dependencies baseline internal1 file
pyproject.toml
- Removed old
tests/test_cli.py(17 lines of basic tests removed) qualify internal1 file
test_cli.py