Add support for excluding specific file extensions in processing #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to exclude specific file extensions from processing in the
readiumtool. 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:
--exclude-extoption 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).ReadConfigclass to include anexclude_extensionsattribute, which takes precedence overinclude_extensionsduring processing (src/readium/config.py, src/readium/config.pyR179).exclude_extensionsattribute in theReadConfigdocstring (src/readium/config.py, src/readium/config.pyL163-R169).Core Logic Enhancements:
should_process_filemethod to check for excluded extensions (case-insensitive) and skip processing files with those extensions (src/readium/core.py, src/readium/core.pyR240-R244).Documentation:
README.mdto explain the new--exclude-extoption and clarify that exclusions take precedence over inclusions (README.md, [1] [2] [3].Testing
tests/test_extension_exclusion.py, with multiple test cases to validate the behavior of theexclude_extensionsfeature:include_extensionsandexclude_extensions.--exclude-extoption.tests/test_extension_exclusion.py, tests/test_extension_exclusion.pyR1-R147).