Skip to content

Release 0.4.0

Choose a tag to compare

@pablotoledo pablotoledo released this 24 Apr 20:56
· 16 commits to main since this release
88fed49

This pull request introduces a new feature to exclude specific file extensions from processing in the readium tool. The changes include updates to the CLI, configuration, core logic, and documentation, as well as the addition of comprehensive tests to ensure the feature works as expected.

New Feature: Exclude File Extensions

CLI and Configuration Updates:

  • Added a new --exclude-ext option to the CLI, allowing users to specify file extensions to exclude from processing. This option can be used multiple times (e.g., --exclude-ext .json --exclude-ext .yml) (src/readium/cli.py, src/readium/cli.pyR87-R92).
  • Updated the ReadConfig class to include an exclude_extensions attribute, which takes precedence over include_extensions during processing (src/readium/config.py, src/readium/config.pyR179).
  • Documented the new exclude_extensions attribute in the ReadConfig docstring (src/readium/config.py, src/readium/config.pyL163-R169).

Core Logic Enhancements:

  • Modified the should_process_file method to check for excluded extensions (case-insensitive) and skip processing files with those extensions (src/readium/core.py, src/readium/core.pyR240-R244).

Documentation:

  • Updated the README.md to explain the new --exclude-ext option and clarify that exclusions take precedence over inclusions (README.md, [1] [2] [3].

Testing

  • Added a new test file, tests/test_extension_exclusion.py, with multiple test cases to validate the behavior of the exclude_extensions feature:
    • Basic exclusion of single and multiple extensions.
    • Interaction between include_extensions and exclude_extensions.
    • Case-insensitive matching of extensions.
    • CLI integration tests for the --exclude-ext option.
    • Tests for excluding all extensions and ensuring no files are processed.
    • Tests for extension exclusion in Git repositories (tests/test_extension_exclusion.py, tests/test_extension_exclusion.pyR1-R147).