yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7.01k stars 818 forks source link

Fix issue with includes not working when no matches are found #1337

Closed shnhrrsn closed 1 year ago

shnhrrsn commented 1 year ago

This PR addresses the issue raised in #1283, where a single includes glob pattern with no matches causes the isIncludedPath function to ignore the includes restriction.

The problem occurs when the isIncludedPath function checks if includePaths is empty, which is true if there are no include patterns or if there are no matches for a pattern. To fix this issue, I changed includePaths to an optional, using nil to indicate that all paths should be allowed.

Additionally, I added a new test case to verify the correct behavior when no matches are found for an includes pattern.

yonaskolb commented 1 year ago

Thanks @shnhrrsn!