{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/62259772","id":62259772,"diff_hunk":"@@ -179,94 +95,61 @@ class AnalyzeCommand extends FlutterCommand {\n \n   Future<int> _analyzeOnce() async {\n     Stopwatch stopwatch = new Stopwatch()..start();\n-    Set<String> pubSpecDirectories = new HashSet<String>();\n-    List<String> dartFiles = argResults.rest.toList();\n+    Set<Directory> pubSpecDirectories = new HashSet<Directory>();\n+    List<File> dartFiles = <File>[];\n \n-    for (String file in dartFiles) {\n+    for (String file in argResults.rest.toList()) {\n       file = path.normalize(path.absolute(file));\n       String root = path.rootPrefix(file);\n+      dartFiles.add(new File(file));\n       while (file != root) {\n         file = path.dirname(file);\n         if (FileSystemEntity.isFileSync(path.join(file, 'pubspec.yaml'))) {\n-          pubSpecDirectories.add(file);\n+          pubSpecDirectories.add(new Directory(file));\n           break;\n         }\n       }\n     }\n \n-    if (argResults['current-directory']) {\n+    //TODO(pq): revisit package and directory defaults\n+\n+    if (argResults['current-directory']  && !argResults['flutter-repo']) {\n       // ./*.dart\n-      Directory currentDirectory = new Directory('.');\n+      Directory cwd = new Directory('.');\n       bool foundOne = false;\n-      for (FileSystemEntity entry in currentDirectory.listSync()) {\n+      for (FileSystemEntity entry in cwd.listSync()) {\n         if (isDartFile(entry)) {\n-          dartFiles.add(entry.path);\n+          dartFiles.add(entry);\n           foundOne = true;\n         }\n       }\n-      if (foundOne)\n-        pubSpecDirectories.add('.');\n+      if (foundOne) {\n+        pubSpecDirectories.add(cwd);\n+      }\n     }\n \n-    if (argResults['current-package'])\n-      _addPackage('.', dartFiles, pubSpecDirectories);\n+    if (argResults['current-package'] && !argResults['flutter-repo']) {\n+      // **/.*dart\n+      Directory cwd = new Directory('.');","path":"packages/flutter_tools/lib/src/commands/analyze.dart","position":156,"original_position":156,"commit_id":"4311ddb461c89c956363a98c80f19a91da81c9ff","original_commit_id":"4311ddb461c89c956363a98c80f19a91da81c9ff","user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"body":"abbreviated variable name here too","created_at":"2016-05-05T21:37:51Z","updated_at":"2016-05-05T21:37:51Z","html_url":"https://github.com/flutter/flutter/pull/3752#discussion_r62259772","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/3752","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/62259772"},"html":{"href":"https://github.com/flutter/flutter/pull/3752#discussion_r62259772"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3752"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/3752","id":69054164,"html_url":"https://github.com/flutter/flutter/pull/3752","diff_url":"https://github.com/flutter/flutter/pull/3752.diff","patch_url":"https://github.com/flutter/flutter/pull/3752.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/3752","number":3752,"state":"open","locked":false,"title":"Analysis re-work to use analyzer APIs.","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"body":"Introduces a new Dart analysis wrapper that works directly with the analyzer API (in favor of shelling out to a separate process).\r\n\r\nSome consequences:\r\n\r\n  * we no longer need to fear parts (simplifying our dart file gathering)\r\n  * we can filter by error code (when needed), rather than by error strings\r\n  * no more IO scraping\r\n  * no need to generate `main()` or to run with `--package-warnings`\r\n  * we now specify an analyzer (and linter) version in the pubspec (we’ll want to make sure this doesn’t diverge too far from the analyzer shipped with the SDK but it does give us some room to play with experimental builds)\r\n  * no more (re)scanning of error source files (and so no more source cache)\r\n  * should generally be a bit simpler and easier to maintain\r\n  * runs a bit faster :)","created_at":"2016-05-05T19:09:41Z","updated_at":"2016-05-05T21:37:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff8b000feb9af13c307788c5e3c2405d21215af1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/3752/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/3752/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/3752/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/4311ddb461c89c956363a98c80f19a91da81c9ff","head":{"label":"pq:analysis_rework","ref":"analysis_rework","sha":"4311ddb461c89c956363a98c80f19a91da81c9ff","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"repo":{"id":53366201,"name":"flutter","full_name":"pq/flutter","owner":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pq/flutter","description":"Framework for building high-performance, high-fidelity iOS and Android apps","fork":true,"url":"https://api.github.com/repos/pq/flutter","forks_url":"https://api.github.com/repos/pq/flutter/forks","keys_url":"https://api.github.com/repos/pq/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pq/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pq/flutter/teams","hooks_url":"https://api.github.com/repos/pq/flutter/hooks","issue_events_url":"https://api.github.com/repos/pq/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/pq/flutter/events","assignees_url":"https://api.github.com/repos/pq/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/pq/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/pq/flutter/tags","blobs_url":"https://api.github.com/repos/pq/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pq/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pq/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/pq/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pq/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/pq/flutter/languages","stargazers_url":"https://api.github.com/repos/pq/flutter/stargazers","contributors_url":"https://api.github.com/repos/pq/flutter/contributors","subscribers_url":"https://api.github.com/repos/pq/flutter/subscribers","subscription_url":"https://api.github.com/repos/pq/flutter/subscription","commits_url":"https://api.github.com/repos/pq/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/pq/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/pq/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/pq/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/pq/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/pq/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pq/flutter/merges","archive_url":"https://api.github.com/repos/pq/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pq/flutter/downloads","issues_url":"https://api.github.com/repos/pq/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/pq/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/pq/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/pq/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pq/flutter/labels{/name}","releases_url":"https://api.github.com/repos/pq/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/pq/flutter/deployments","created_at":"2016-03-07T23:17:48Z","updated_at":"2016-03-07T23:17:50Z","pushed_at":"2016-05-05T20:40:12Z","git_url":"git://github.com/pq/flutter.git","ssh_url":"git@github.com:pq/flutter.git","clone_url":"https://github.com/pq/flutter.git","svn_url":"https://github.com/pq/flutter","homepage":"http://flutter.io","size":16967,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"flutter:master","ref":"master","sha":"2592f8f4b6fdf6b2062d918a142c2e87a75a14bf","user":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"repo":{"id":31792824,"name":"flutter","full_name":"flutter/flutter","owner":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flutter/flutter","description":"Framework for building high-performance, high-fidelity iOS and Android apps","fork":false,"url":"https://api.github.com/repos/flutter/flutter","forks_url":"https://api.github.com/repos/flutter/flutter/forks","keys_url":"https://api.github.com/repos/flutter/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/flutter/teams","hooks_url":"https://api.github.com/repos/flutter/flutter/hooks","issue_events_url":"https://api.github.com/repos/flutter/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/flutter/events","assignees_url":"https://api.github.com/repos/flutter/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/flutter/tags","blobs_url":"https://api.github.com/repos/flutter/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/flutter/languages","stargazers_url":"https://api.github.com/repos/flutter/flutter/stargazers","contributors_url":"https://api.github.com/repos/flutter/flutter/contributors","subscribers_url":"https://api.github.com/repos/flutter/flutter/subscribers","subscription_url":"https://api.github.com/repos/flutter/flutter/subscription","commits_url":"https://api.github.com/repos/flutter/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/flutter/merges","archive_url":"https://api.github.com/repos/flutter/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/flutter/downloads","issues_url":"https://api.github.com/repos/flutter/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/flutter/labels{/name}","releases_url":"https://api.github.com/repos/flutter/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/flutter/deployments","created_at":"2015-03-06T22:54:58Z","updated_at":"2016-05-05T15:59:09Z","pushed_at":"2016-05-05T21:26:22Z","git_url":"git://github.com/flutter/flutter.git","ssh_url":"git@github.com:flutter/flutter.git","clone_url":"https://github.com/flutter/flutter.git","svn_url":"https://github.com/flutter/flutter","homepage":"http://flutter.io","size":110801,"stargazers_count":2763,"watchers_count":2763,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":892,"forks":283,"open_issues":892,"watchers":2763,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3752"},"html":{"href":"https://github.com/flutter/flutter/pull/3752"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/3752"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/3752/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3752/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3752/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/4311ddb461c89c956363a98c80f19a91da81c9ff"}}}}