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.py Replaced Click command group with a single flat @click.command(); fixed shell wrapper to use python -m bfiles.cli
  • bundle.py Removed — bundle command folded into flat CLI
  • greet.py Removed — was example command in old command group
  • sum_numbers.py Removed — 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() in cli.py decouple behavioral
    1 file
    • cli.py
  • Removed entire commands/ subpackage (bundle, greet, sum_numbers) decouple internal
    3 files
    • bundle.py
    • greet.py
    • sum_numbers.py
  • Fixed the bfiles shell wrapper to use python -m bfiles.cli instead of python -m src.bfiles.cli remediate behavioral
    1 file
    • cli.py

Configuration module

1 file changed
  • config.py BfilesConfig dataclass centralizing output settings, encoding, exclusion patterns, metadata template, and display options; patterns compiled to regex at init
  • Added BfilesConfig dataclass centralizing output file settings, encoding, exclusion patterns, metadata template, and display options baseline behavioral
    1 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.py ExclusionManager handling file/directory exclusions with glob and regex, tracking skipped directories and excluded files with reasons
  • New ExclusionManager class handling file/directory exclusions based on globs and regex instantiate internal
    1 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.py MetadataWriter with customizable template-based formatting; sanitizes file content and writes to output files
  • New MetadataWriter class with customizable template-based metadata formatting instantiate errata
    1 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.py Dedicated logging module for the project

Core refactoring

1 file changed
  • bundler.py bundle_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 internal
    1 file
    • bundler.py
  • Integrated ExclusionManager for directory pruning and file exclusion during walk decouple internal
    1 file
    • bundler.py
  • Integrated MetadataWriter for formatted output generation decouple behavioral
    1 file
    • bundler.py
  • Changed bundle format markers from --- BOF/EOF --- to >>> BEGIN <<< / <<< END >>> decouple errata
    1 file
    • bundler.py