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
5627e0d1
Unverified
Commit
5627e0d1
authored
Aug 09, 2022
by
Jesús S Guerrero
Committed by
GitHub
Aug 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add info project validator status (#109169)
parent
0fa8f765
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
17 deletions
+16
-17
validate_project.dart
...ages/flutter_tools/lib/src/commands/validate_project.dart
+1
-0
project_validator.dart
packages/flutter_tools/lib/src/project_validator.dart
+11
-14
project_validator_result.dart
packages/flutter_tools/lib/src/project_validator_result.dart
+1
-0
pub_dependencies_project_validator_test.dart
...eneral.shard/pub_dependencies_project_validator_test.dart
+3
-3
No files found.
packages/flutter_tools/lib/src/commands/validate_project.dart
View file @
5627e0d1
...
@@ -76,6 +76,7 @@ class ValidateProject {
...
@@ -76,6 +76,7 @@ class ValidateProject {
case
StatusProjectValidator
.
error
:
case
StatusProjectValidator
.
error
:
icon
=
'[✗]'
;
icon
=
'[✗]'
;
break
;
break
;
case
StatusProjectValidator
.
info
:
case
StatusProjectValidator
.
success
:
case
StatusProjectValidator
.
success
:
icon
=
'[✓]'
;
icon
=
'[✓]'
;
break
;
break
;
...
...
packages/flutter_tools/lib/src/project_validator.dart
View file @
5627e0d1
...
@@ -153,25 +153,22 @@ class PubDependenciesProjectValidator extends ProjectValidator {
...
@@ -153,25 +153,22 @@ class PubDependenciesProjectValidator extends ProjectValidator {
}
}
}
}
final
String
value
;
if
(
dependencies
.
isNotEmpty
)
{
if
(
dependencies
.
isNotEmpty
)
{
final
String
verb
=
dependencies
.
length
==
1
?
'is'
:
'are'
;
final
String
verb
=
dependencies
.
length
==
1
?
'is'
:
'are'
;
result
.
add
(
value
=
'
${dependencies.join(', ')}
$verb
not hosted'
;
ProjectValidatorResult
(
name:
name
,
value:
'
${dependencies.join(', ')}
$verb
not hosted'
,
status:
StatusProjectValidator
.
warning
,
)
);
}
else
{
}
else
{
result
.
add
(
value
=
'All pub dependencies are hosted on https://pub.dartlang.org'
;
const
ProjectValidatorResult
(
name:
name
,
value:
'All pub dependencies are hosted on https://pub.dartlang.org'
,
status:
StatusProjectValidator
.
success
,
)
);
}
}
result
.
add
(
ProjectValidatorResult
(
name:
name
,
value:
value
,
status:
StatusProjectValidator
.
info
,
)
);
return
result
;
return
result
;
}
}
...
...
packages/flutter_tools/lib/src/project_validator_result.dart
View file @
5627e0d1
...
@@ -7,6 +7,7 @@ enum StatusProjectValidator {
...
@@ -7,6 +7,7 @@ enum StatusProjectValidator {
warning
,
warning
,
success
,
success
,
crash
,
crash
,
info
,
}
}
class
ProjectValidatorResult
{
class
ProjectValidatorResult
{
...
...
packages/flutter_tools/test/general.shard/pub_dependencies_project_validator_test.dart
View file @
5627e0d1
...
@@ -35,7 +35,7 @@ void main() {
...
@@ -35,7 +35,7 @@ void main() {
const
String
expected
=
'All pub dependencies are hosted on https://pub.dartlang.org'
;
const
String
expected
=
'All pub dependencies are hosted on https://pub.dartlang.org'
;
expect
(
result
.
length
,
1
);
expect
(
result
.
length
,
1
);
expect
(
result
[
0
].
value
,
expected
);
expect
(
result
[
0
].
value
,
expected
);
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
success
);
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
info
);
});
});
testWithoutContext
(
'error when command dart pub deps fails'
,
()
async
{
testWithoutContext
(
'error when command dart pub deps fails'
,
()
async
{
...
@@ -56,7 +56,7 @@ void main() {
...
@@ -56,7 +56,7 @@ void main() {
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
error
);
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
error
);
});
});
testWithoutContext
(
'
warning
on dependencies not hosted'
,
()
async
{
testWithoutContext
(
'
info
on dependencies not hosted'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'dart'
,
'pub'
,
'deps'
,
'--json'
],
command:
<
String
>[
'dart'
,
'pub'
,
'deps'
,
'--json'
],
...
@@ -71,7 +71,7 @@ void main() {
...
@@ -71,7 +71,7 @@ void main() {
const
String
expected
=
'dep1, dep2 are not hosted'
;
const
String
expected
=
'dep1, dep2 are not hosted'
;
expect
(
result
.
length
,
1
);
expect
(
result
.
length
,
1
);
expect
(
result
[
0
].
value
,
expected
);
expect
(
result
[
0
].
value
,
expected
);
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
warning
);
expect
(
result
[
0
].
status
,
StatusProjectValidator
.
info
);
});
});
});
});
}
}
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