Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
db5711bf
Unverified
Commit
db5711bf
authored
Mar 17, 2023
by
Ian Hickson
Committed by
GitHub
Mar 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove obsolete todo in doubleClamp lint (#122745)
remove obsolete todo in doubleClamp lint
parent
80d6c105
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
analyze.dart
dev/bots/analyze.dart
+14
-20
No files found.
dev/bots/analyze.dart
View file @
db5711bf
...
...
@@ -220,11 +220,11 @@ Future<void> run(List<String> arguments) async {
FeatureSet
_parsingFeatureSet
(
)
=>
FeatureSet
.
latestLanguageVersion
();
_Line
_getLine
(
ParseStringResult
parseResult
,
int
offset
)
{
final
int
lineNumber
=
parseResult
.
lineInfo
.
getLocation
(
offset
).
lineNumber
;
final
int
lineNumber
=
parseResult
.
lineInfo
.
getLocation
(
offset
).
lineNumber
;
final
String
content
=
parseResult
.
content
.
substring
(
parseResult
.
lineInfo
.
getOffsetOfLine
(
lineNumber
-
1
),
parseResult
.
lineInfo
.
getOffsetOfLine
(
lineNumber
)
-
1
);
parseResult
.
lineInfo
.
getOffsetOfLine
(
lineNumber
)
-
1
,
);
return
_Line
(
lineNumber
,
content
);
}
...
...
@@ -264,7 +264,6 @@ Future<void> verifyNoDoubleClamp(String workingDirectory) async {
_allFiles
(
flutterLibPath
,
'dart'
,
minimumMatches:
100
);
final
List
<
String
>
errors
=
<
String
>[];
await
for
(
final
File
file
in
testFiles
)
{
try
{
final
ParseStringResult
parseResult
=
parseFile
(
featureSet:
_parsingFeatureSet
(),
path:
file
.
absolute
.
path
,
...
...
@@ -272,19 +271,14 @@ Future<void> verifyNoDoubleClamp(String workingDirectory) async {
final
_DoubleClampVisitor
visitor
=
_DoubleClampVisitor
(
parseResult
);
visitor
.
visitCompilationUnit
(
parseResult
.
unit
);
for
(
final
_Line
clamp
in
visitor
.
clamps
)
{
errors
.
add
(
'
${file.path}
:
${clamp.line}
: `clamp` method used without ignore_clamp_double_lint comment.'
);
}
}
catch
(
ex
)
{
// TODO(gaaclarke): There is a bug with super parameter parsing on mac so
// we skip certain files until that is fixed.
// https://github.com/dart-lang/sdk/issues/49032
print
(
'skipping
${file.path}
:
$ex
'
);
errors
.
add
(
'
${file.path}
:
${clamp.line}
: `clamp` method used instead of `clampDouble`.'
);
}
}
if
(
errors
.
isNotEmpty
)
{
foundError
(<
String
>[
...
errors
,
'
\n
${bold}
See: https://github.com/flutter/flutter/pull/103559'
,
'
\n
${bold}
For performance reasons, we use a custom `clampDouble` function instead of using `Double.clamp`.
$reset
'
,
'
\n
${bold}
For non-double uses of `clamp`, use `// ignore_clamp_double_lint` on the line to silence this message.
$reset
'
,
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment