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
48fe65c2
Unverified
Commit
48fe65c2
authored
Oct 19, 2018
by
Devon Carew
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow todos in user code to show in IDEs (#23303)
parent
de9f18d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
analysis_options_user.yaml
packages/flutter/lib/analysis_options_user.yaml
+0
-2
analyze_once.dart
packages/flutter_tools/lib/src/commands/analyze_once.dart
+2
-1
analyze_once_test.dart
packages/flutter_tools/test/commands/analyze_once_test.dart
+18
-0
No files found.
packages/flutter/lib/analysis_options_user.yaml
View file @
48fe65c2
...
...
@@ -24,8 +24,6 @@ analyzer:
errors
:
# treat missing required parameters as a warning (not a hint)
missing_required_param
:
warning
# allow having TODOs in the code
todo
:
ignore
linter
:
rules
:
...
...
packages/flutter_tools/lib/src/commands/analyze_once.dart
View file @
48fe65c2
...
...
@@ -87,7 +87,8 @@ class AnalyzeOnce extends AnalyzeBase {
}
});
server
.
onErrors
.
listen
((
FileAnalysisErrors
fileErrors
)
{
errors
.
addAll
(
fileErrors
.
errors
);
// Record the issues found (but filter out to do comments).
errors
.
addAll
(
fileErrors
.
errors
.
where
((
AnalysisError
error
)
=>
error
.
type
!=
'TODO'
));
});
await
server
.
start
();
...
...
packages/flutter_tools/test/commands/analyze_once_test.dart
View file @
48fe65c2
...
...
@@ -178,6 +178,24 @@ StringBuffer bar = StringBuffer('baz');
tryToDelete
(
tempDir
);
}
});
testUsingContext
(
'returns no issues for todo comments'
,
()
async
{
const
String
contents
=
'''
// TODO(foobar):
StringBuffer bar = StringBuffer('
baz
');
'''
;
final
Directory
tempDir
=
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_analyze_once_test_4.'
);
tempDir
.
childFile
(
'main.dart'
).
writeAsStringSync
(
contents
);
try
{
await
runCommand
(
command:
AnalyzeCommand
(
workingDirectory:
fs
.
directory
(
tempDir
)),
arguments:
<
String
>[
'analyze'
],
statusTextContains:
<
String
>[
'No issues found!'
],
);
}
finally
{
tryToDelete
(
tempDir
);
}
});
});
}
...
...
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