Add wildcard pattern support for —exclude
option
#300
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.
Summary
Enhances the path exclusion functionality to support wildcard patterns:
This change allows for more flexible and precise control over which paths
should be excluded during processing, without requiring third-party dependencies.
Reasoning
Currently, only fixed folders are supported, and wildcards are not supported. This is not easy to use in some scenarios. For example, Tuist will put the automatically generated files into the
Derived
folder. These folders may be scattered in multiple subfolders of the same project, such as the following:After adding the wildcard function, you can use
--exclude "Derived/"
to exclude allDerived
directories. When adding new submodules in the future, there is no need to modify the format configuration.Break
This change affects existing functionality. For the original README:
Now matches all paths containing a file or directory component named "Test", e.g.
Tests
(a singleTests
file or directory)path/to/Tests
(a file or directory namedTests
at any level)src/Tests/file.swift
(a path containing aTests
directory)