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
424a6b1d
Commit
424a6b1d
authored
Apr 18, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle files disappearing during analysis (#3390)
parent
29fdc7a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
37 deletions
+36
-37
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+36
-37
No files found.
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
424a6b1d
...
...
@@ -363,53 +363,52 @@ class AnalyzeCommand extends FlutterCommand {
String
errorMessage
=
groups
[
2
];
int
lineNumber
=
int
.
parse
(
groups
[
4
]);
int
colNumber
=
int
.
parse
(
groups
[
5
]);
File
source
=
new
File
(
filename
);
List
<
String
>
sourceLines
=
source
.
readAsLinesSync
();
String
sourceLine
;
try
{
File
source
=
new
File
(
filename
);
List
<
String
>
sourceLines
=
source
.
readAsLinesSync
();
if
(
lineNumber
>
sourceLines
.
length
)
throw
new
FileChanged
();
sourceLine
=
sourceLines
[
lineNumber
-
1
];
String
sourceLine
=
sourceLines
[
lineNumber
-
1
];
if
(
colNumber
>
sourceLine
.
length
)
throw
new
FileChanged
();
}
on
FileChanged
{
if
(
changedFiles
.
add
(
filename
))
printError
(
'[warning] File shrank during analysis (
$filename
)'
);
sourceLine
=
''
;
lineNumber
=
1
;
colNumber
=
1
;
}
bool
shouldIgnore
=
false
;
if
(
documentAllMembersPattern
.
firstMatch
(
errorMessage
)
!=
null
)
{
// https://github.com/dart-lang/linter/issues/207
// https://github.com/dart-lang/linter/issues/208
if
(
isFlutterLibrary
(
filename
))
{
if
(!
argResults
[
'dartdocs'
])
{
membersMissingDocumentation
+=
1
;
bool
shouldIgnore
=
false
;
if
(
documentAllMembersPattern
.
firstMatch
(
errorMessage
)
!=
null
)
{
// https://github.com/dart-lang/linter/issues/207
// https://github.com/dart-lang/linter/issues/208
if
(
isFlutterLibrary
(
filename
))
{
if
(!
argResults
[
'dartdocs'
])
{
membersMissingDocumentation
+=
1
;
shouldIgnore
=
true
;
}
}
else
{
shouldIgnore
=
true
;
}
}
else
{
}
else
if
(
filename
==
mainFile
.
path
)
{
Match
libs
=
conflictingNamesPattern
.
firstMatch
(
errorMessage
);
Match
missing
=
missingFilePattern
.
firstMatch
(
errorMessage
);
if
(
libs
!=
null
)
{
errorLine
=
'[
$level
]
$errorMessage
(
${dartFiles[lineNumber-1]}
)'
;
// strip the reference to the generated main.dart
}
else
if
(
missing
!=
null
)
{
errorLine
=
'[
$level
] File does not exist (
${missing[1]}
)'
;
}
else
{
errorLine
+=
' (Please file a bug on the "flutter analyze" command saying that you saw this message.)'
;
}
}
else
if
(
filename
.
endsWith
(
'.mojom.dart'
))
{
// autogenerated code - TODO(ianh): Fix the Dart mojom compiler
shouldIgnore
=
true
;
}
else
if
(
sourceLines
.
first
.
startsWith
(
'// DO NOT EDIT. This is code generated'
))
{
// autogenerated code - TODO(ianh): Fix the intl package resource generator
shouldIgnore
=
true
;
}
}
else
if
(
filename
==
mainFile
.
path
)
{
Match
libs
=
conflictingNamesPattern
.
firstMatch
(
errorMessage
);
Match
missing
=
missingFilePattern
.
firstMatch
(
errorMessage
);
if
(
libs
!=
null
)
{
errorLine
=
'[
$level
]
$errorMessage
(
${dartFiles[lineNumber-1]}
)'
;
// strip the reference to the generated main.dart
}
else
if
(
missing
!=
null
)
{
errorLine
=
'[
$level
] File does not exist (
${missing[1]}
)'
;
}
else
{
errorLine
+=
' (Please file a bug on the "flutter analyze" command saying that you saw this message.)'
;
}
}
else
if
(
filename
.
endsWith
(
'.mojom.dart'
))
{
// autogenerated code - TODO(ianh): Fix the Dart mojom compiler
shouldIgnore
=
true
;
}
else
if
(
sourceLines
.
first
.
startsWith
(
'// DO NOT EDIT. This is code generated'
))
{
// autogenerated code - TODO(ianh): Fix the intl package resource generator
shouldIgnore
=
true
;
if
(
shouldIgnore
)
continue
;
}
on
FileSystemException
catch
(
exception
)
{
if
(
changedFiles
.
add
(
filename
))
printError
(
'[warning] Could not read file (
${exception.message}${ exception.osError != null ? "; ${exception.osError}
" : ""}) (
$filename
)'
);
}
on
FileChanged
{
if
(
changedFiles
.
add
(
filename
))
printError
(
'[warning] File shrank during analysis (
$filename
)'
);
}
if
(
shouldIgnore
)
continue
;
}
printError
(
errorLine
);
errorCount
+=
1
;
...
...
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