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
e271e842
Unverified
Commit
e271e842
authored
Aug 19, 2022
by
Jesús S Guerrero
Committed by
GitHub
Aug 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add GeneralInfo project validator to analyze --suggestions (#109874)
parent
646666f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
executable.dart
packages/flutter_tools/lib/executable.dart
+1
-1
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+4
-0
args_test.dart
packages/flutter_tools/test/general.shard/args_test.dart
+7
-0
No files found.
packages/flutter_tools/lib/executable.dart
View file @
e271e842
...
...
@@ -143,7 +143,7 @@ List<FlutterCommand> generateCommands({
terminal:
globals
.
terminal
,
artifacts:
globals
.
artifacts
!,
// new ProjectValidators should be added here for the --suggestions to run
allProjectValidators:
<
ProjectValidator
>[],
allProjectValidators:
<
ProjectValidator
>[
GeneralInfoProjectValidator
()
],
),
AssembleCommand
(
verboseHelp:
verboseHelp
,
buildSystem:
globals
.
buildSystem
),
AttachCommand
(
verboseHelp:
verboseHelp
),
...
...
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
e271e842
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:meta/meta.dart'
;
import
'package:process/process.dart'
;
import
'../artifacts.dart'
;
...
...
@@ -112,6 +113,9 @@ class AnalyzeCommand extends FlutterCommand {
@override
String
get
category
=>
FlutterCommandCategory
.
project
;
@visibleForTesting
List
<
ProjectValidator
>
allProjectValidators
()
=>
_allProjectValidators
;
@override
bool
get
shouldRunPub
{
// If they're not analyzing the current project.
...
...
packages/flutter_tools/test/general.shard/args_test.dart
View file @
e271e842
...
...
@@ -7,6 +7,7 @@
import
'package:args/args.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/executable.dart'
as
executable
;
import
'package:flutter_tools/src/commands/analyze.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'package:flutter_tools/src/runner/flutter_command_runner.dart'
;
...
...
@@ -23,6 +24,12 @@ void main() {
verbose:
true
,
).
forEach
(
runner
.
addCommand
);
verifyCommandRunner
(
runner
);
for
(
final
Command
<
void
>
command
in
runner
.
commands
.
values
)
{
if
(
command
.
name
==
'analyze'
)
{
final
AnalyzeCommand
analyze
=
command
as
AnalyzeCommand
;
expect
(
analyze
.
allProjectValidators
().
length
,
1
);
}
}
}));
testUsingContext
(
'bool? safe argResults'
,
()
async
{
...
...
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