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.
Update the isIncludedPath function to handle optional includePaths.
Modify the getSourceChildren function to accept an optional includePaths parameter.
Adjust the getSourceFiles function to work with optional includePaths.
Update the generate function to handle an optional includePaths.
Additionally, I added a new test case to verify the correct behavior when no matches are found for an includes pattern.
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 ifincludePaths
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 changedincludePaths
to an optional, usingnil
to indicate that all paths should be allowed.isIncludedPath
function to handle optionalincludePaths
.getSourceChildren
function to accept an optionalincludePaths
parameter.getSourceFiles
function to work with optionalincludePaths
.includePaths
.Additionally, I added a new test case to verify the correct behavior when no matches are found for an includes pattern.