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

fix: match hidden directories for path exclusions #87

Merged

Conversation

vvanpo
Copy link
Contributor

@vvanpo vvanpo commented Feb 26, 2021

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Globstars don't match paths with hidden directories by default: isaacs/minimatch#51
This means the default exclude option of **/node_modules/** will fail for projects anchored at a path like /foo/.bar/. E.g. it is fairly common for developers to mimic FHS directory structures in their home directory using .local, meaning repositories are cloned within ~/.local/src/, which would not be matched by the default globstar. In all likelihood most users would expect matching hidden directories to be the default behaviour.

Globstars don't match paths with hidden directories by default:
isaacs/minimatch#51
This means the default `exclude` option of `**/node_modules/**` will
fail for projects anchored at a path like /foo/.bar/. E.g. it is fairly
common for developers to mimic FHS directory structures in their home
directory using `.local`, meaning repositories are cloned within
`~/.local/src/`, which would not be matched by the default globstar. In
all likelihood most users would expect matching hidden directories to be
the default behaviour.
@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #87 (942d655) into master (0b83cc5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #87   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          253       253           
  Branches        72        72           
=========================================
  Hits           253       253           
Impacted Files Coverage Δ
src/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b83cc5...942d655. Read the comment docs.

@ricardogobbosouza ricardogobbosouza dismissed stale reviews from alexander-akait and themself via 942d655 March 24, 2021 16:03
@ricardogobbosouza ricardogobbosouza changed the title fix: 🐛 Match hidden directories for path exclusions fix: match hidden directories for path exclusions Mar 24, 2021
@ricardogobbosouza ricardogobbosouza merged commit bb8750c into webpack-contrib:master Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants