bfiles
2024-12-10
CLI simplified to a flat command and new config, exclusion, metadata, and logger modules introduced
16 files · 451+ · 123-
CLI simplification
4 files changed
cli.pyReplaced Click command group with a single flat @click.command(); fixed shell wrapper to use python -m bfiles.clibundle.pyRemoved — bundle command folded into flat CLIgreet.pyRemoved — was example command in old command groupsum_numbers.pyRemoved — was example command in old command group
- Replaced Click command group with subcommands (
commands/bundle.py,commands/greet.py,commands/sum_numbers.py) with a single flat@click.command()incli.pydecouple behavioral1 file
cli.py
- Removed entire
commands/subpackage (bundle, greet, sum_numbers) decouple internal3 files
bundle.pygreet.pysum_numbers.py
- Fixed the
bfilesshell wrapper to usepython -m bfiles.cliinstead ofpython -m src.bfiles.cliremediate behavioral1 file
cli.py
Configuration module
1 file changed
config.pyBfilesConfig dataclass centralizing output settings, encoding, exclusion patterns, metadata template, and display options; patterns compiled to regex at init
- Added
BfilesConfigdataclass centralizing output file settings, encoding, exclusion patterns, metadata template, and display options baseline behavioral1 file
config.py
- Exclusion patterns compiled to regex at init time for efficient matching
instantiate
architectural
1 file
config.py
- Includes dynamic pattern addition and path exclusion checking methods
decouple
internal
1 file
config.py
Exclusion manager
1 file changed
exclusions.pyExclusionManager handling file/directory exclusions with glob and regex, tracking skipped directories and excluded files with reasons
- New
ExclusionManagerclass handling file/directory exclusions based on globs and regex instantiate internal1 file
exclusions.py
- Tracks skipped directories and excluded files with reasons
decouple
internal
1 file
exclusions.py
- Provides condensed and detailed exclusion reporting
decouple
internal
1 file
exclusions.py
Metadata writer
1 file changed
metadata_writer.pyMetadataWriter with customizable template-based formatting; sanitizes file content and writes to output files
- New
MetadataWriterclass with customizable template-based metadata formatting instantiate errata1 file
metadata_writer.py
- Handles sanitization of file content (newline escaping) and writes to output files
decouple
behavioral
1 file
metadata_writer.py
Logger module
1 file changed
logger.pyDedicated logging module for the project
- Added dedicated logging module for the project
instantiate
behavioral
1 file
logger.py
Core refactoring
1 file changed
bundler.pybundle_files() rewritten to accept direct parameters; integrates ExclusionManager and MetadataWriter; changed bundle markers
- Rewrote
bundle_files()to accept direct parameters instead of a config object baseline internal1 file
bundler.py
- Integrated
ExclusionManagerfor directory pruning and file exclusion during walk decouple internal1 file
bundler.py
- Integrated
MetadataWriterfor formatted output generation decouple behavioral1 file
bundler.py
- Changed bundle format markers from
--- BOF/EOF ---to>>> BEGIN <<< / <<< END >>>decouple errata1 file
bundler.py