@@ -220,11 +220,11 @@ Future<void> run(List<String> arguments) async {
220
220
FeatureSet _parsingFeatureSet () => FeatureSet .latestLanguageVersion ();
221
221
222
222
_Line _getLine (ParseStringResult parseResult, int offset) {
223
- final int lineNumber =
224
- parseResult.lineInfo.getLocation (offset).lineNumber;
223
+ final int lineNumber = parseResult.lineInfo.getLocation (offset).lineNumber;
225
224
final String content = parseResult.content.substring (
226
- parseResult.lineInfo.getOffsetOfLine (lineNumber - 1 ),
227
- parseResult.lineInfo.getOffsetOfLine (lineNumber) - 1 );
225
+ parseResult.lineInfo.getOffsetOfLine (lineNumber - 1 ),
226
+ parseResult.lineInfo.getOffsetOfLine (lineNumber) - 1 ,
227
+ );
228
228
return _Line (lineNumber, content);
229
229
}
230
230
@@ -264,27 +264,21 @@ Future<void> verifyNoDoubleClamp(String workingDirectory) async {
264
264
_allFiles (flutterLibPath, 'dart' , minimumMatches: 100 );
265
265
final List <String > errors = < String > [];
266
266
await for (final File file in testFiles) {
267
- try {
268
- final ParseStringResult parseResult = parseFile (
269
- featureSet: _parsingFeatureSet (),
270
- path: file.absolute.path,
271
- );
272
- final _DoubleClampVisitor visitor = _DoubleClampVisitor (parseResult);
273
- visitor.visitCompilationUnit (parseResult.unit);
274
- for (final _Line clamp in visitor.clamps) {
275
- errors.add ('${file .path }:${clamp .line }: `clamp` method used without ignore_clamp_double_lint comment.' );
276
- }
277
- } catch (ex) {
278
- // TODO(gaaclarke): There is a bug with super parameter parsing on mac so
279
- // we skip certain files until that is fixed.
280
- // https://github.com/dart-lang/sdk/issues/49032
281
- print ('skipping ${file .path }: $ex ' );
267
+ final ParseStringResult parseResult = parseFile (
268
+ featureSet: _parsingFeatureSet (),
269
+ path: file.absolute.path,
270
+ );
271
+ final _DoubleClampVisitor visitor = _DoubleClampVisitor (parseResult);
272
+ visitor.visitCompilationUnit (parseResult.unit);
273
+ for (final _Line clamp in visitor.clamps) {
274
+ errors.add ('${file .path }:${clamp .line }: `clamp` method used instead of `clampDouble`.' );
282
275
}
283
276
}
284
277
if (errors.isNotEmpty) {
285
278
foundError (< String > [
286
279
...errors,
287
- '\n ${bold }See: https://github.com/flutter/flutter/pull/103559' ,
280
+ '\n ${bold }For performance reasons, we use a custom `clampDouble` function instead of using `Double.clamp`.$reset ' ,
281
+ '\n ${bold }For non-double uses of `clamp`, use `// ignore_clamp_double_lint` on the line to silence this message.$reset ' ,
288
282
]);
289
283
}
290
284
}
0 commit comments