@@ -31,20 +31,15 @@ class AnalyzeContinuously extends AnalyzeBase {
31
31
Stopwatch analysisTimer;
32
32
int lastErrorCount = 0 ;
33
33
Status analysisStatus;
34
- bool flutterRepo;
35
- bool showDartDocIssuesIndividually;
36
34
37
35
@override
38
36
Future <Null > analyze () async {
39
37
List <String > directories;
40
38
41
- flutterRepo = argResults['flutter-repo' ] || inRepo ( null );
42
- showDartDocIssuesIndividually = argResults[ ' dartdocs' ] ;
39
+ if ( argResults['dartdocs' ])
40
+ throwToolExit ( 'The -- dartdocs option is currently not supported when using --watch.' ) ;
43
41
44
- if (showDartDocIssuesIndividually && ! flutterRepo)
45
- throwToolExit ('The --dartdocs option is only supported when using --flutter-repo.' );
46
-
47
- if (flutterRepo) {
42
+ if (argResults['flutter-repo' ]) {
48
43
final PackageDependencyTracker dependencies = new PackageDependencyTracker ();
49
44
dependencies.checkForConflictingDependencies (repoPackages, dependencies);
50
45
directories = repoPackages.map ((Directory dir) => dir.path).toList ();
@@ -57,7 +52,7 @@ class AnalyzeContinuously extends AnalyzeBase {
57
52
analysisTarget = fs.currentDirectory.path;
58
53
}
59
54
60
- final AnalysisServer server = new AnalysisServer (dartSdkPath, directories, flutterRepo : flutterRepo );
55
+ final AnalysisServer server = new AnalysisServer (dartSdkPath, directories);
61
56
server.onAnalyzing.listen ((bool isAnalyzing) => _handleAnalysisStatus (server, isAnalyzing));
62
57
server.onErrors.listen (_handleAnalysisErrors);
63
58
@@ -87,52 +82,29 @@ class AnalyzeContinuously extends AnalyzeBase {
87
82
logger.printStatus (terminal.clearScreen (), newline: false );
88
83
89
84
// Remove errors for deleted files, sort, and print errors.
90
- final List <AnalysisError > allErrors = < AnalysisError > [];
85
+ final List <AnalysisError > errors = < AnalysisError > [];
91
86
for (String path in analysisErrors.keys.toList ()) {
92
87
if (fs.isFileSync (path)) {
93
- allErrors .addAll (analysisErrors[path]);
88
+ errors .addAll (analysisErrors[path]);
94
89
} else {
95
90
analysisErrors.remove (path);
96
91
}
97
92
}
98
93
99
- // Summarize dartdoc issues rather than displaying each individually
100
- int membersMissingDocumentation = 0 ;
101
- List <AnalysisError > detailErrors;
102
- if (flutterRepo && ! showDartDocIssuesIndividually) {
103
- detailErrors = allErrors.where ((AnalysisError error) {
104
- if (error.code == 'public_member_api_docs' ) {
105
- // https://github.com/dart-lang/linter/issues/208
106
- if (isFlutterLibrary (error.file))
107
- membersMissingDocumentation += 1 ;
108
- return true ;
109
- }
110
- return false ;
111
- }).toList ();
112
- } else {
113
- detailErrors = allErrors;
114
- }
115
-
116
- detailErrors.sort ();
94
+ errors.sort ();
117
95
118
- for (AnalysisError error in detailErrors ) {
96
+ for (AnalysisError error in errors ) {
119
97
printStatus (error.toString ());
120
98
if (error.code != null )
121
99
printTrace ('error code: ${error .code }' );
122
100
}
123
101
124
- dumpErrors (detailErrors.map <String >((AnalysisError error) => error.toLegacyString ()));
125
-
126
- if (membersMissingDocumentation != 0 ) {
127
- printStatus (membersMissingDocumentation == 1
128
- ? '1 public member lacks documentation'
129
- : '$membersMissingDocumentation public members lack documentation' );
130
- }
102
+ dumpErrors (errors.map <String >((AnalysisError error) => error.toLegacyString ()));
131
103
132
104
// Print an analysis summary.
133
105
String errorsMessage;
134
106
135
- final int issueCount = detailErrors .length;
107
+ final int issueCount = errors .length;
136
108
final int issueDiff = issueCount - lastErrorCount;
137
109
lastErrorCount = issueCount;
138
110
@@ -178,11 +150,10 @@ class AnalyzeContinuously extends AnalyzeBase {
178
150
}
179
151
180
152
class AnalysisServer {
181
- AnalysisServer (this .sdk, this .directories, { this .flutterRepo : false } );
153
+ AnalysisServer (this .sdk, this .directories);
182
154
183
155
final String sdk;
184
156
final List <String > directories;
185
- final bool flutterRepo;
186
157
187
158
Process _process;
188
159
final StreamController <bool > _analyzingController = new StreamController <bool >.broadcast ();
@@ -198,13 +169,6 @@ class AnalysisServer {
198
169
'--sdk' ,
199
170
sdk,
200
171
];
201
- // Let the analysis server know that the flutter repository is being analyzed
202
- // so that it can enable the public_member_api_docs lint even though
203
- // the analysis_options file does not have that lint enabled.
204
- // It is not enabled in the analysis_option file
205
- // because doing so causes too much noise in the IDE.
206
- if (flutterRepo)
207
- command.add ('--flutter-repo' );
208
172
209
173
printTrace ('dart ${command .skip (1 ).join (' ' )}' );
210
174
_process = await processManager.start (command);
0 commit comments