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
b18047bf
Commit
b18047bf
authored
Feb 27, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2234 from Hixie/analyzer
Handle lines getting shorter during analysis
parents
f6bd20ff
a9040433
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+19
-1
No files found.
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
b18047bf
...
@@ -76,6 +76,8 @@ bool _addPackage(String directoryPath, List<String> dartFiles, Set<String> pubSp
...
@@ -76,6 +76,8 @@ bool _addPackage(String directoryPath, List<String> dartFiles, Set<String> pubSp
return
false
;
return
false
;
}
}
class
FileChanged
{
}
class
AnalyzeCommand
extends
FlutterCommand
{
class
AnalyzeCommand
extends
FlutterCommand
{
String
get
name
=>
'analyze'
;
String
get
name
=>
'analyze'
;
String
get
description
=>
'Analyze the project
\'
s Dart code.'
;
String
get
description
=>
'Analyze the project
\'
s Dart code.'
;
...
@@ -360,6 +362,8 @@ linter:
...
@@ -360,6 +362,8 @@ linter:
RegExp
ignorePattern
=
new
RegExp
(
r'// analyzer says "([^"]+)"'
);
RegExp
ignorePattern
=
new
RegExp
(
r'// analyzer says "([^"]+)"'
);
RegExp
conflictingNamesPattern
=
new
RegExp
(
'^The imported libraries
\'
([^
\'
]+)
\'
and
\'
([^
\'
]+)
\'
cannot have the same name
\'
([^
\'
]+)
\'
\$
'
);
RegExp
conflictingNamesPattern
=
new
RegExp
(
'^The imported libraries
\'
([^
\'
]+)
\'
and
\'
([^
\'
]+)
\'
cannot have the same name
\'
([^
\'
]+)
\'
\$
'
);
Set
<
String
>
changedFiles
=
new
Set
<
String
>();
// files about which we've complained that they changed
List
<
String
>
errorLines
=
output
.
toString
().
split
(
'
\n
'
);
List
<
String
>
errorLines
=
output
.
toString
().
split
(
'
\n
'
);
for
(
String
errorLine
in
errorLines
)
{
for
(
String
errorLine
in
errorLines
)
{
if
(
patternsToSkip
.
every
((
Pattern
pattern
)
=>
pattern
.
allMatches
(
errorLine
).
isEmpty
))
{
if
(
patternsToSkip
.
every
((
Pattern
pattern
)
=>
pattern
.
allMatches
(
errorLine
).
isEmpty
))
{
...
@@ -372,7 +376,20 @@ linter:
...
@@ -372,7 +376,20 @@ linter:
int
colNumber
=
int
.
parse
(
groups
[
5
]);
int
colNumber
=
int
.
parse
(
groups
[
5
]);
File
source
=
new
File
(
filename
);
File
source
=
new
File
(
filename
);
List
<
String
>
sourceLines
=
source
.
readAsLinesSync
();
List
<
String
>
sourceLines
=
source
.
readAsLinesSync
();
String
sourceLine
=
(
lineNumber
<
sourceLines
.
length
)
?
sourceLines
[
lineNumber
-
1
]
:
''
;
String
sourceLine
;
try
{
if
(
lineNumber
>
sourceLines
.
length
)
throw
new
FileChanged
();
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
;
bool
shouldIgnore
=
false
;
if
(
filename
==
mainFile
.
path
)
{
if
(
filename
==
mainFile
.
path
)
{
Match
libs
=
conflictingNamesPattern
.
firstMatch
(
errorMessage
);
Match
libs
=
conflictingNamesPattern
.
firstMatch
(
errorMessage
);
...
@@ -423,3 +440,4 @@ linter:
...
@@ -423,3 +440,4 @@ linter:
return
0
;
return
0
;
}
}
}
}
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