{"action":"created","comment":{"url":"https://api.github.com/repos/eslint/eslint/pulls/comments/74677791","id":74677791,"diff_hunk":"@@ -190,34 +190,46 @@ IgnoredPaths.prototype.contains = function(filepath, category) {\n \n /**\n  * Returns a list of dir patterns for glob to ignore\n- * @returns {string[]} list of glob ignore patterns\n+ * @returns {function()} method to check whether a folder should be ignored by glob.\n  */\n-IgnoredPaths.prototype.getIgnoredFoldersGlobPatterns = function() {\n-    let dirs = DEFAULT_IGNORE_DIRS;\n+IgnoredPaths.prototype.getIgnoredFoldersGlobChecker = function() {\n \n-    if (this.options.ignore) {\n+    /**\n+     * Adds `\"*\"` at the end of `\"node_modules/\"`,\n+     * so that subtle directories could be re-included by .gitignore patterns\n+     * such as `\"!node_modules/should_not_ignored\"`\n+     */\n+    const dirs = DEFAULT_IGNORE_DIRS.map(function(dir) {","path":"lib/ignored-paths.js","position":26,"original_position":26,"commit_id":"0a2449ced616ed8a6a2225ca405ecc09db6c0bc3","original_commit_id":"0a2449ced616ed8a6a2225ca405ecc09db6c0bc3","user":{"login":"IanVS","id":4616705,"avatar_url":"https://avatars.githubusercontent.com/u/4616705?v=3","gravatar_id":"","url":"https://api.github.com/users/IanVS","html_url":"https://github.com/IanVS","followers_url":"https://api.github.com/users/IanVS/followers","following_url":"https://api.github.com/users/IanVS/following{/other_user}","gists_url":"https://api.github.com/users/IanVS/gists{/gist_id}","starred_url":"https://api.github.com/users/IanVS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanVS/subscriptions","organizations_url":"https://api.github.com/users/IanVS/orgs","repos_url":"https://api.github.com/users/IanVS/repos","events_url":"https://api.github.com/users/IanVS/events{/privacy}","received_events_url":"https://api.github.com/users/IanVS/received_events","type":"User","site_admin":false},"body":"It seems my previous comment https://github.com/eslint/eslint/pull/6783#discussion_r73985714 was lost in the rebase.  I still think it would be cleaner to just make the `DEFAULT_IGNORE_DIRS` the way we want them.","created_at":"2016-08-13T00:48:33Z","updated_at":"2016-08-13T00:48:33Z","html_url":"https://github.com/eslint/eslint/pull/6783#discussion_r74677791","pull_request_url":"https://api.github.com/repos/eslint/eslint/pulls/6783","_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments/74677791"},"html":{"href":"https://github.com/eslint/eslint/pull/6783#discussion_r74677791"},"pull_request":{"href":"https://api.github.com/repos/eslint/eslint/pulls/6783"}}},"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/6783","id":79150704,"html_url":"https://github.com/eslint/eslint/pull/6783","diff_url":"https://github.com/eslint/eslint/pull/6783.diff","patch_url":"https://github.com/eslint/eslint/pull/6783.patch","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6783","number":6783,"state":"open","locked":false,"title":"Fix: Improves perf of globbing by inheriting glob.GlobSync (fixes #6710)","user":{"login":"kaelzhang","id":352304,"avatar_url":"https://avatars.githubusercontent.com/u/352304?v=3","gravatar_id":"","url":"https://api.github.com/users/kaelzhang","html_url":"https://github.com/kaelzhang","followers_url":"https://api.github.com/users/kaelzhang/followers","following_url":"https://api.github.com/users/kaelzhang/following{/other_user}","gists_url":"https://api.github.com/users/kaelzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/kaelzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaelzhang/subscriptions","organizations_url":"https://api.github.com/users/kaelzhang/orgs","repos_url":"https://api.github.com/users/kaelzhang/repos","events_url":"https://api.github.com/users/kaelzhang/events{/privacy}","received_events_url":"https://api.github.com/users/kaelzhang/received_events","type":"User","site_admin":false},"body":"<!--\r\nThanks for submitting a pull request to ESLint. Before continuing, please be sure you've read over our guidelines:\r\nhttp://eslint.org/docs/developer-guide/contributing/pull-requests\r\n\r\nSpecifically, all pull requests containing code require an **accepted** issue (documentation-only pull requests do not require an issue). If this pull request contains code and there isn't yet an issue explaining why you're submitting this pull request, please stop and open a new issue first.\r\n\r\nPlease answer all questions below.\r\n-->\r\n\r\n**What issue does this pull request address?**\r\nAs #6710 discussed, I create a subclass of `glob.GlobSync` to skip certain glob process according to .gitignore rules.\r\n\r\n**What changes did you make? (Give an overview)**\r\n- inherits `glob.GlobSync` and overrides `_readdir`, special thanks to the good idea of @mysticatea. But there are several detail things we should aware of, see the inline comments of the commit.\r\n- change `ignoredPaths.getIgnoredFoldersGlobPatterns()` -> `ignoredPaths.getIgnoredFoldersGlobChecker()`, and now it will return a function.\r\n\r\n**Is there anything you'd like reviewers to focus on?**\r\nDo I need to create a specific test cases file for `lib/glob.js`? Or just testing it with `glob-util.js` is ok? I did create a test file, because I thought there was much duplication with `tests/lib/glob-util.js`\r\n\r\nIf it is necessary, I will add one.","created_at":"2016-07-28T07:45:52Z","updated_at":"2016-08-13T00:48:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a764668b8b8d8e1a04f2f52b0f532e53b95171b4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eslint/eslint/pulls/6783/commits","review_comments_url":"https://api.github.com/repos/eslint/eslint/pulls/6783/comments","review_comment_url":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6783/comments","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/0a2449ced616ed8a6a2225ca405ecc09db6c0bc3","head":{"label":"kaelzhang:feature/inherited-glob-sync","ref":"feature/inherited-glob-sync","sha":"0a2449ced616ed8a6a2225ca405ecc09db6c0bc3","user":{"login":"kaelzhang","id":352304,"avatar_url":"https://avatars.githubusercontent.com/u/352304?v=3","gravatar_id":"","url":"https://api.github.com/users/kaelzhang","html_url":"https://github.com/kaelzhang","followers_url":"https://api.github.com/users/kaelzhang/followers","following_url":"https://api.github.com/users/kaelzhang/following{/other_user}","gists_url":"https://api.github.com/users/kaelzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/kaelzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaelzhang/subscriptions","organizations_url":"https://api.github.com/users/kaelzhang/orgs","repos_url":"https://api.github.com/users/kaelzhang/repos","events_url":"https://api.github.com/users/kaelzhang/events{/privacy}","received_events_url":"https://api.github.com/users/kaelzhang/received_events","type":"User","site_admin":false},"repo":{"id":58016266,"name":"eslint","full_name":"kaelzhang/eslint","owner":{"login":"kaelzhang","id":352304,"avatar_url":"https://avatars.githubusercontent.com/u/352304?v=3","gravatar_id":"","url":"https://api.github.com/users/kaelzhang","html_url":"https://github.com/kaelzhang","followers_url":"https://api.github.com/users/kaelzhang/followers","following_url":"https://api.github.com/users/kaelzhang/following{/other_user}","gists_url":"https://api.github.com/users/kaelzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/kaelzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaelzhang/subscriptions","organizations_url":"https://api.github.com/users/kaelzhang/orgs","repos_url":"https://api.github.com/users/kaelzhang/repos","events_url":"https://api.github.com/users/kaelzhang/events{/privacy}","received_events_url":"https://api.github.com/users/kaelzhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaelzhang/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":true,"url":"https://api.github.com/repos/kaelzhang/eslint","forks_url":"https://api.github.com/repos/kaelzhang/eslint/forks","keys_url":"https://api.github.com/repos/kaelzhang/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaelzhang/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaelzhang/eslint/teams","hooks_url":"https://api.github.com/repos/kaelzhang/eslint/hooks","issue_events_url":"https://api.github.com/repos/kaelzhang/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/kaelzhang/eslint/events","assignees_url":"https://api.github.com/repos/kaelzhang/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/kaelzhang/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/kaelzhang/eslint/tags","blobs_url":"https://api.github.com/repos/kaelzhang/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaelzhang/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaelzhang/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaelzhang/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaelzhang/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/kaelzhang/eslint/languages","stargazers_url":"https://api.github.com/repos/kaelzhang/eslint/stargazers","contributors_url":"https://api.github.com/repos/kaelzhang/eslint/contributors","subscribers_url":"https://api.github.com/repos/kaelzhang/eslint/subscribers","subscription_url":"https://api.github.com/repos/kaelzhang/eslint/subscription","commits_url":"https://api.github.com/repos/kaelzhang/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaelzhang/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaelzhang/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaelzhang/eslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaelzhang/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/kaelzhang/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaelzhang/eslint/merges","archive_url":"https://api.github.com/repos/kaelzhang/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaelzhang/eslint/downloads","issues_url":"https://api.github.com/repos/kaelzhang/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/kaelzhang/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/kaelzhang/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/kaelzhang/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaelzhang/eslint/labels{/name}","releases_url":"https://api.github.com/repos/kaelzhang/eslint/releases{/id}","deployments_url":"https://api.github.com/repos/kaelzhang/eslint/deployments","created_at":"2016-05-04T02:20:15Z","updated_at":"2016-05-04T02:20:21Z","pushed_at":"2016-08-11T04:47:30Z","git_url":"git://github.com/kaelzhang/eslint.git","ssh_url":"git@github.com:kaelzhang/eslint.git","clone_url":"https://github.com/kaelzhang/eslint.git","svn_url":"https://github.com/kaelzhang/eslint","homepage":"http://eslint.org","size":12153,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eslint:master","ref":"master","sha":"e8cb7f9aa0d31d1f2443009f98bfb7d9c0d95806","user":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"repo":{"id":11061773,"name":"eslint","full_name":"eslint/eslint","owner":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eslint/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":false,"url":"https://api.github.com/repos/eslint/eslint","forks_url":"https://api.github.com/repos/eslint/eslint/forks","keys_url":"https://api.github.com/repos/eslint/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eslint/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eslint/eslint/teams","hooks_url":"https://api.github.com/repos/eslint/eslint/hooks","issue_events_url":"https://api.github.com/repos/eslint/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/eslint/eslint/events","assignees_url":"https://api.github.com/repos/eslint/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/eslint/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/eslint/eslint/tags","blobs_url":"https://api.github.com/repos/eslint/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eslint/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eslint/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/eslint/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/eslint/eslint/languages","stargazers_url":"https://api.github.com/repos/eslint/eslint/stargazers","contributors_url":"https://api.github.com/repos/eslint/eslint/contributors","subscribers_url":"https://api.github.com/repos/eslint/eslint/subscribers","subscription_url":"https://api.github.com/repos/eslint/eslint/subscription","commits_url":"https://api.github.com/repos/eslint/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/eslint/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/eslint/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/eslint/eslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/eslint/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/eslint/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eslint/eslint/merges","archive_url":"https://api.github.com/repos/eslint/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eslint/eslint/downloads","issues_url":"https://api.github.com/repos/eslint/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/eslint/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/eslint/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/eslint/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eslint/eslint/labels{/name}","releases_url":"https://api.github.com/repos/eslint/eslint/releases{/id}","deployments_url":"https://api.github.com/repos/eslint/eslint/deployments","created_at":"2013-06-29T23:59:48Z","updated_at":"2016-08-13T00:29:06Z","pushed_at":"2016-08-12T22:52:55Z","git_url":"git://github.com/eslint/eslint.git","ssh_url":"git@github.com:eslint/eslint.git","clone_url":"https://github.com/eslint/eslint.git","svn_url":"https://github.com/eslint/eslint","homepage":"http://eslint.org","size":18112,"stargazers_count":5608,"watchers_count":5608,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1097,"mirror_url":null,"open_issues_count":232,"forks":1097,"open_issues":232,"watchers":5608,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/6783"},"html":{"href":"https://github.com/eslint/eslint/pull/6783"},"issue":{"href":"https://api.github.com/repos/eslint/eslint/issues/6783"},"comments":{"href":"https://api.github.com/repos/eslint/eslint/issues/6783/comments"},"review_comments":{"href":"https://api.github.com/repos/eslint/eslint/pulls/6783/comments"},"review_comment":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eslint/eslint/pulls/6783/commits"},"statuses":{"href":"https://api.github.com/repos/eslint/eslint/statuses/0a2449ced616ed8a6a2225ca405ecc09db6c0bc3"}}}}
{"actor":{"display_login":"IanVS"}}