{"action":"created","comment":{"url":"https://api.github.com/repos/eslint/eslint/pulls/comments/38118938","id":38118938,"diff_hunk":"@@ -372,30 +400,60 @@ CLIEngine.prototype = {\n     executeOnFiles: function(files) {\n \n         var results = [],\n-            processed = [],\n+            processed = {},\n             options = this.options,\n             configHelper = new Config(options),\n-            ignoredPaths = IgnoredPaths.load(options),\n-            exclude = ignoredPaths.contains.bind(ignoredPaths),\n+            ignoredPaths = options.ignore ? IgnoredPaths.load(options).patterns : [],\n+            extensions = options.extensions.map(function(ext) {\n+                return ext.charAt(0) === \".\" ? ext : \".\" + ext;\n+            }),\n+            globOptions,\n             stats;\n \n-        traverse({\n-            files: files,\n-            extensions: options.extensions,\n-            exclude: options.ignore ? exclude : false\n-        }, function(filename) {\n+        files = files.map(processPath);\n+        ignoredPaths = ignoredPaths.map(processPath);\n+\n+        globOptions = {\n+            nodir: true,\n+            realpath: true,\n+            ignore: ignoredPaths\n+        };\n+\n+        /**\n+         * Executes the linter on a file defined by the `filename`. Skips\n+         * unsupported file extensions and any files that are already linted.\n+         * @param {string} filename The file to be linted\n+         * @returns {void}\n+         */\n+        function executeOnFile(filename) {\n+            if (extensions.indexOf(path.extname(filename)) === -1 || processed[filename]) {\n+                return;\n+            }\n \n             debug(\"Processing \" + filename);\n \n-            processed.push(filename);\n+            processed[filename] = true;\n             results.push(processFile(filename, configHelper));\n+        }\n+\n+        files.forEach(function(pattern) {\n+            glob.sync(pattern, globOptions).forEach(executeOnFile);\n         });\n \n         // only warn for files explicitly passed on the command line\n         if (options.ignore) {\n             files.forEach(function(file) {\n-                if (fs.statSync(path.resolve(file)).isFile() && processed.indexOf(file) === -1) {\n-                    results.push(createIgnoreResult(file));\n+                // Since `file` can be a glob pattern, we need the try-catch around\n+                // `fs.statSync` calls.\n+                try {","path":"lib/cli-engine.js","position":null,"original_position":116,"commit_id":"687a963e0278669532d99e14ca87d13e57ea3d9b","original_commit_id":"e25755acf26d712210ea1c85320c4f60801fdf52","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"body":"Okay, updated to use `shelljs` :)","created_at":"2015-08-27T16:57:44Z","updated_at":"2015-08-27T16:57:44Z","html_url":"https://github.com/eslint/eslint/pull/3496#discussion_r38118938","pull_request_url":"https://api.github.com/repos/eslint/eslint/pulls/3496","_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments/38118938"},"html":{"href":"https://github.com/eslint/eslint/pull/3496#discussion_r38118938"},"pull_request":{"href":"https://api.github.com/repos/eslint/eslint/pulls/3496"}}},"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/3496","id":43119726,"html_url":"https://github.com/eslint/eslint/pull/3496","diff_url":"https://github.com/eslint/eslint/pull/3496.diff","patch_url":"https://github.com/eslint/eslint/pull/3496.patch","issue_url":"https://api.github.com/repos/eslint/eslint/issues/3496","number":3496,"state":"open","locked":false,"title":"New: Support glob path on command line","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"body":"Fixes #3402","created_at":"2015-08-23T11:26:12Z","updated_at":"2015-08-27T16:57:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ab6d8c87456cf6523cc2494bbc9c4e4ca442a80","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eslint/eslint/pulls/3496/commits","review_comments_url":"https://api.github.com/repos/eslint/eslint/pulls/3496/comments","review_comment_url":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/3496/comments","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/687a963e0278669532d99e14ca87d13e57ea3d9b","head":{"label":"eslint:issue-3402","ref":"issue-3402","sha":"687a963e0278669532d99e14ca87d13e57ea3d9b","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}","created_at":"2013-06-29T23:59:48Z","updated_at":"2015-08-27T15:37:02Z","pushed_at":"2015-08-27T16:56:48Z","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":20444,"stargazers_count":2772,"watchers_count":2772,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":526,"mirror_url":null,"open_issues_count":143,"forks":526,"open_issues":143,"watchers":2772,"default_branch":"master"}},"base":{"label":"eslint:master","ref":"master","sha":"d4402568c1b3045b6b3a5927396e9d0111a71165","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}","created_at":"2013-06-29T23:59:48Z","updated_at":"2015-08-27T15:37:02Z","pushed_at":"2015-08-27T16:56:48Z","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":20444,"stargazers_count":2772,"watchers_count":2772,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":526,"mirror_url":null,"open_issues_count":143,"forks":526,"open_issues":143,"watchers":2772,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/3496"},"html":{"href":"https://github.com/eslint/eslint/pull/3496"},"issue":{"href":"https://api.github.com/repos/eslint/eslint/issues/3496"},"comments":{"href":"https://api.github.com/repos/eslint/eslint/issues/3496/comments"},"review_comments":{"href":"https://api.github.com/repos/eslint/eslint/pulls/3496/comments"},"review_comment":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eslint/eslint/pulls/3496/commits"},"statuses":{"href":"https://api.github.com/repos/eslint/eslint/statuses/687a963e0278669532d99e14ca87d13e57ea3d9b"}}}}