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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore .git, .svn and .hg directories #4906

Merged
merged 2 commits into from Jul 29, 2018

Conversation

@azz
Copy link
Member

commented Jul 29, 2018

Don't really see a compelling case for a CLI argument for this.

Fixes #4895

Note: Can't actually add a .git test because git ignores the files 馃槈

@@ -403,6 +403,7 @@ function eachFilename(context, patterns, callback) {
if (ignoreNodeModules) {
patterns = patterns.concat(["!**/node_modules/**", "!./node_modules/**"]);
}
patterns = patterns.concat(["!**/.{git,svn,hg}/**", "!./.{git,svn,hg}/**"]);

This comment has been minimized.

Copy link
@ikatyang

ikatyang Jul 29, 2018

Member

It seems the !./.{git,svn,hg}/** part is unnecessary, and so does !./node_modules/**.

$ tree test
test
鈹溾攢鈹 dir
鈹   鈹溾攢鈹 node_modules
鈹   鈹   鈹斺攢鈹 x.js
鈹   鈹斺攢鈹 x.js
鈹溾攢鈹 node_modules
鈹   鈹斺攢鈹 x.js
鈹斺攢鈹 x.js

$ node -e 'console.log(
  require("globby").sync(
    ["**/*.js", "!**/node_modules/**"],
    { cwd: "test" }
  )
)'
[ 'dir/x.js', 'x.js' ]

This comment has been minimized.

Copy link
@azz

azz Jul 29, 2018

Author Member

This comment has been minimized.

Copy link
@azz

azz Jul 29, 2018

Author Member

Try re-running that with ./**/*.js as the glob.

This comment has been minimized.

Copy link
@ikatyang

ikatyang Jul 29, 2018

Member

Cool, didn't know that. Can you add a comment for it?

This comment has been minimized.

Copy link
@azz

azz Jul 29, 2018

Author Member

Sure.

@azz azz merged commit a938076 into prettier:master Jul 29, 2018

10 checks passed

ci/circleci: build_prod Your tests passed on CircleCI!
Details
ci/circleci: checkout_code Your tests passed on CircleCI!
Details
ci/circleci: test_prod_node4 Your tests passed on CircleCI!
Details
ci/circleci: test_prod_node9 Your tests passed on CircleCI!
Details
ci/circleci: test_prod_standalone Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 80%)
Details
codecov/project 96.47% (+<.01%) compared to 440ab4f
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@azz azz deleted the azz:git-exclude branch Jul 29, 2018

@ikatyang ikatyang added this to the 1.14.1 milestone Aug 2, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.