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
d291de08
Unverified
Commit
d291de08
authored
Jan 09, 2020
by
LongCatIsLooong
Committed by
GitHub
Jan 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a diagnostic message for malformed imports in analyze.dart (#38355)
parent
1df6e2af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
analyze.dart
dev/bots/analyze.dart
+19
-0
No files found.
dev/bots/analyze.dart
View file @
d291de08
...
...
@@ -435,6 +435,22 @@ Future<void> verifyNoBadImportsInFlutter(String workingDirectory) async {
);
}
}
for
(
final
String
key
in
dependencyMap
.
keys
)
{
for
(
final
String
dependency
in
dependencyMap
[
key
])
{
if
(
dependencyMap
[
dependency
]
!=
null
)
continue
;
// Sanity check before performing _deepSearch, to ensure there's no rogue
// dependencies.
final
String
validFilenames
=
dependencyMap
.
keys
.
map
((
String
name
)
=>
name
+
'.dart'
).
join
(
', '
);
errors
.
add
(
'
$key
imported package:flutter/
$dependency
.dart '
'which is not one of the valid exports {
$validFilenames
}.
\n
'
'Consider changing
$dependency
.dart to one of them.'
);
}
}
for
(
final
String
package
in
dependencyMap
.
keys
)
{
final
List
<
String
>
loop
=
_deepSearch
<
String
>(
dependencyMap
,
package
);
if
(
loop
!=
null
)
{
...
...
@@ -1180,6 +1196,9 @@ Set<String> _findFlutterDependencies(String srcPath, List<String> errors, { bool
}
List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) {
if (map[start] == null)
return null; // We catch these separately.
for (final T key in map[start]) {
if (key == start)
continue; // we catch these separately
...
...
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