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
5d938942
Unverified
Commit
5d938942
authored
Oct 26, 2022
by
Lucas Britto
Committed by
GitHub
Oct 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Decouple fatal-warnings check from fatal-infos (#113748)
parent
d988c11a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
analyze_once.dart
packages/flutter_tools/lib/src/commands/analyze_once.dart
+1
-2
analyze_once_test.dart
...utter_tools/test/integration.shard/analyze_once_test.dart
+25
-1
No files found.
packages/flutter_tools/lib/src/commands/analyze_once.dart
View file @
5d938942
...
...
@@ -167,8 +167,7 @@ class AnalyzeOnce extends AnalyzeBase {
if
(
severityLevel
==
AnalysisSeverity
.
error
)
{
return
true
;
}
if
(
severityLevel
==
AnalysisSeverity
.
warning
&&
(
argResults
[
'fatal-warnings'
]
as
bool
||
argResults
[
'fatal-infos'
]
as
bool
))
{
if
(
severityLevel
==
AnalysisSeverity
.
warning
&&
argResults
[
'fatal-warnings'
]
as
bool
)
{
return
true
;
}
if
(
severityLevel
==
AnalysisSeverity
.
info
&&
argResults
[
'fatal-infos'
]
as
bool
)
{
...
...
packages/flutter_tools/test/integration.shard/analyze_once_test.dart
View file @
5d938942
...
...
@@ -339,7 +339,7 @@ int analyze() {}
);
});
testWithoutContext
(
'analyze once only fatal-infos has warning issue finally exit code
1
.'
,
()
async
{
testWithoutContext
(
'analyze once only fatal-infos has warning issue finally exit code
0
.'
,
()
async
{
const
String
warningSourceCode
=
'''
int analyze() {}
'''
;
...
...
@@ -359,6 +359,30 @@ analyzer:
'missing_return'
,
],
exitMessageContains:
'1 issue found.'
,
);
});
testWithoutContext
(
'analyze once only fatal-warnings has warning issue finally exit code 1.'
,
()
async
{
const
String
warningSourceCode
=
'''
int analyze() {}
'''
;
final
File
optionsFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
projectPath
,
'analysis_options.yaml'
));
optionsFile
.
writeAsStringSync
(
'''
analyzer:
errors:
missing_return: warning
'''
);
fileSystem
.
directory
(
projectPath
).
childFile
(
'main.dart'
).
writeAsStringSync
(
warningSourceCode
);
await
runCommand
(
arguments:
<
String
>[
'analyze'
,
'--no-pub'
,
'--no-fatal-infos'
,
'--fatal-warnings'
],
statusTextContains:
<
String
>[
'warning'
,
'missing_return'
,
],
exitMessageContains:
'1 issue found.'
,
exitCode:
1
,
);
});
...
...
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