-
-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude multiple paths in a glob #937
Exclude multiple paths in a glob #937
Conversation
Adds descriptions of params to the new initializer Improves code readability
var excluded: [AbsolutePath] = [] | ||
source.excluding?.forEach { path in | ||
let absolute = AbsolutePath(path) | ||
let globs = AbsolutePath(absolute.dirname).glob(absolute.basename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: you could use flatMap
and simply return the array of paths created here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that reduce
would suit better, because for every item of the excluding
array another array of globs
is generated, which needs to be appended to the excluded
array.
As a newcomer to the project it took my a while to understand what each type in the transformation is, so I decided to use the code as you see, without flat mapping - reduce magic 馃敭.
d4ec3b0
to
0180d6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on your first contribution @paciej00. Changes look good to me. There are some minor bits remaining:
- Update the CHANGELOG.
- Solve git conflicts.
- Solve the swiftformat issues.
@pepibumur thanks ! I updated the CHANGELOG yesterday, however there is a problem with
Is there a way to merge |
Short description 馃摑
Prior to the change it was possible to exclude a single source file/glob pattern from a target (#808, #913). The change introduces a way to exclude multiple files/globs from a target:
Solution 馃摝
Initializer of
SourceFileGlob
now takes an array of items to be excluded. The signature of old initializer was left for backward-compatibility.