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
1d4693fc
Commit
1d4693fc
authored
Dec 04, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #719 from Hixie/analyzer
Analyzer improvements
parents
2b47efc9
0290622b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+8
-4
No files found.
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
1d4693fc
...
...
@@ -256,9 +256,9 @@ class AnalyzeCommand extends FlutterCommand {
];
RegExp
generalPattern
=
new
RegExp
(
r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$'
);
RegExp
ignorePattern
=
new
RegExp
(
r'// analyzer says "([^"]+)"
'
);
RegExp
allowedIdentifiersPattern
=
new
RegExp
(
r'_?([A-Z]|_+)\b
'
);
RegExp
constructorTearOffsPattern
=
new
RegExp
(
'.+#.+// analyzer doesn
\'
t like constructor tear-offs'
);
RegExp
allowedIdentifiers
=
new
RegExp
(
r'_?([A-Z]|_+)\b
'
);
RegExp
ignorePattern
=
new
RegExp
(
r'// analyzer says "([^"]+)"
'
);
List
<
String
>
errorLines
=
output
.
toString
().
split
(
'
\n
'
);
for
(
String
errorLine
in
errorLines
)
{
...
...
@@ -272,12 +272,16 @@ class AnalyzeCommand extends FlutterCommand {
int
colNumber
=
int
.
parse
(
groups
[
5
]);
File
source
=
new
File
(
filename
);
List
<
String
>
sourceLines
=
source
.
readAsLinesSync
();
String
sourceLine
=
sourceLines
[
lineNumber
-
1
]
;
String
sourceLine
=
(
lineNumber
<
sourceLines
.
length
)
?
sourceLines
[
lineNumber
-
1
]
:
''
;
bool
shouldIgnore
=
false
;
if
(
filename
.
endsWith
(
'.mojom.dart'
))
{
// autogenerated code - TODO(ianh): Fix the Dart mojom compiler
shouldIgnore
=
true
;
}
else
if
((
sourceLines
[
0
]
==
'/**'
)
&&
(
' * DO NOT EDIT. This is code generated'
.
matchAsPrefix
(
sourceLines
[
1
])
!=
null
))
{
// autogenerated code - TODO(ianh): Fix the intl package resource generator
shouldIgnore
=
true
;
}
else
if
(
level
==
'lint'
&&
errorMessage
==
'Name non-constant identifiers using lowerCamelCase.'
)
{
if
(
allowedIdentifiers
.
matchAsPrefix
(
sourceLine
,
colNumber
-
1
)
!=
null
)
if
(
allowedIdentifiers
Pattern
.
matchAsPrefix
(
sourceLine
,
colNumber
-
1
)
!=
null
)
shouldIgnore
=
true
;
}
else
if
(
constructorTearOffsPattern
.
allMatches
(
sourceLine
).
isNotEmpty
)
{
shouldIgnore
=
true
;
...
...
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