Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: allow exclude option in globs to accept glob patterns #56489

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

daeyeon
Copy link
Member

@daeyeon daeyeon commented Jan 6, 2025

This patch extends the exclude option in glob functions (fs.glob, fs.globSync, and fsPromises.glob) to support glob patterns.

Resolves #56254

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jan 6, 2025
@daeyeon daeyeon added the semver-minor PRs that contain new features and should be released in the next minor version. label Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 89.83051% with 12 lines in your changes missing coverage. Please review.

Project coverage is 89.12%. Comparing base (383e1a2) to head (4cf780d).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/fs/glob.js 89.83% 11 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56489      +/-   ##
==========================================
+ Coverage   88.52%   89.12%   +0.59%     
==========================================
  Files         658      662       +4     
  Lines      190811   191660     +849     
  Branches    36621    36890     +269     
==========================================
+ Hits       168920   170813    +1893     
+ Misses      15080    13702    -1378     
- Partials     6811     7145     +334     
Files with missing lines Coverage Δ
lib/internal/fs/glob.js 92.14% <89.83%> (-0.49%) ⬇️

... and 82 files with indirect coverage changes

@daeyeon daeyeon added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jan 7, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 7, 2025
@nodejs-github-bot

This comment was marked as off-topic.

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Jan 7, 2025

CI failures are relevant to the change and aren't flakes.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon daeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 8, 2025
@daeyeon
Copy link
Member Author

daeyeon commented Jan 8, 2025

test at test/parallel/test-fs-glob.mjs:455:5
✖ a/**/[cg]/../[cg] - exclude: ["a/abcdef/g","a/abcfed/g","a/b/c","a/c","a/c/d/c",null] (0.156424ms)
  TypeError [ERR_INVALID_ARG_TYPE]: The "options.exclude[5]" property must be of type string. Received null

@jasnell Thanks for letting me know. On Windows, the exclude pattern contained a null. Fixed.

@daeyeon daeyeon added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Jan 8, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 8, 2025
@nodejs-github-bot

This comment was marked as outdated.

@daeyeon daeyeon added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. labels Jan 8, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@daeyeon daeyeon added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 8, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 8, 2025
@nodejs-github-bot nodejs-github-bot merged commit dc5d0f9 into nodejs:main Jan 8, 2025
69 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in dc5d0f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make glob function accept a glob pattern for the exclude option like Deno
6 participants