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
ce4e9cd6
Commit
ce4e9cd6
authored
Mar 18, 2016
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only require documentation for libraries.
parent
991b50e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+25
-1
No files found.
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
ce4e9cd6
...
...
@@ -138,6 +138,25 @@ class AnalyzeCommand extends FlutterCommand {
return
argResults
[
'watch'
]
?
_analyzeWatch
()
:
_analyzeOnce
();
}
List
<
String
>
flutterRootComponents
;
bool
isFlutterLibrary
(
String
filename
)
{
flutterRootComponents
??=
path
.
normalize
(
path
.
absolute
(
ArtifactStore
.
flutterRoot
)).
split
(
path
.
separator
);
List
<
String
>
filenameComponents
=
path
.
normalize
(
path
.
absolute
(
filename
)).
split
(
path
.
separator
);
if
(
filenameComponents
.
length
<
flutterRootComponents
.
length
+
4
)
// the 4: 'packages', package_name, 'lib', file_name
return
false
;
for
(
int
index
=
0
;
index
<
flutterRootComponents
.
length
;
index
+=
1
)
{
if
(
flutterRootComponents
[
index
]
!=
filenameComponents
[
index
])
return
false
;
}
if
(
filenameComponents
[
flutterRootComponents
.
length
]
!=
'packages'
)
return
false
;
if
(
filenameComponents
[
flutterRootComponents
.
length
+
1
]
==
'flutter_tools'
)
return
false
;
if
(
filenameComponents
[
flutterRootComponents
.
length
+
2
]
!=
'lib'
)
return
false
;
return
true
;
}
Future
<
int
>
_analyzeOnce
()
async
{
Stopwatch
stopwatch
=
new
Stopwatch
()..
start
();
Set
<
String
>
pubSpecDirectories
=
new
HashSet
<
String
>();
...
...
@@ -343,6 +362,7 @@ class AnalyzeCommand extends FlutterCommand {
RegExp
constructorTearOffsPattern
=
new
RegExp
(
'.+#.+// analyzer doesn
\'
t like constructor tear-offs'
);
RegExp
conflictingNamesPattern
=
new
RegExp
(
'^The imported libraries
\'
([^
\'
]+)
\'
and
\'
([^
\'
]+)
\'
cannot have the same name
\'
([^
\'
]+)
\'
\$
'
);
RegExp
missingFilePattern
=
new
RegExp
(
'^Target of URI does not exist:
\'
([^
\'
)]+)
\'
\$
'
);
RegExp
documentAllMembersPattern
=
new
RegExp
(
'^Document all public memm?bers
\$
'
);
Set
<
String
>
changedFiles
=
new
Set
<
String
>();
// files about which we've complained that they changed
...
...
@@ -373,7 +393,11 @@ class AnalyzeCommand extends FlutterCommand {
colNumber
=
1
;
}
bool
shouldIgnore
=
false
;
if
(
filename
==
mainFile
.
path
)
{
if
(
documentAllMembersPattern
.
firstMatch
(
errorMessage
)
!=
null
)
{
// https://github.com/dart-lang/linter/issues/207
// https://github.com/dart-lang/linter/issues/208
shouldIgnore
=
!
isFlutterLibrary
(
filename
);
}
else
if
(
filename
==
mainFile
.
path
)
{
Match
libs
=
conflictingNamesPattern
.
firstMatch
(
errorMessage
);
Match
missing
=
missingFilePattern
.
firstMatch
(
errorMessage
);
if
(
libs
!=
null
)
{
...
...
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