Unverified Commit 8b0de38e authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

fix upcoming lint avoid_returning_null_for_void (#23190)

parent cab7ecb8
...@@ -44,7 +44,7 @@ Future<void> runCommand(String executable, List<String> arguments, { ...@@ -44,7 +44,7 @@ Future<void> runCommand(String executable, List<String> arguments, {
final String relativeWorkingDir = path.relative(workingDirectory); final String relativeWorkingDir = path.relative(workingDirectory);
if (skip) { if (skip) {
printProgress('SKIPPING', relativeWorkingDir, commandDescription); printProgress('SKIPPING', relativeWorkingDir, commandDescription);
return null; return;
} }
printProgress('RUNNING', relativeWorkingDir, commandDescription); printProgress('RUNNING', relativeWorkingDir, commandDescription);
......
...@@ -28,7 +28,7 @@ Future<void> main(List<String> rawArgs) async { ...@@ -28,7 +28,7 @@ Future<void> main(List<String> rawArgs) async {
stderr.writeln('Usage:\n'); stderr.writeln('Usage:\n');
stderr.writeln(_argParser.usage); stderr.writeln(_argParser.usage);
exitCode = 1; exitCode = 1;
return null; return;
} }
if (!args.wasParsed('task')) { if (!args.wasParsed('task')) {
...@@ -50,7 +50,7 @@ Future<void> main(List<String> rawArgs) async { ...@@ -50,7 +50,7 @@ Future<void> main(List<String> rawArgs) async {
if (_taskNames.isEmpty) { if (_taskNames.isEmpty) {
stderr.writeln('Failed to find tasks to run based on supplied options.'); stderr.writeln('Failed to find tasks to run based on supplied options.');
exitCode = 1; exitCode = 1;
return null; return;
} }
final bool silent = args['silent']; final bool silent = args['silent'];
......
...@@ -407,7 +407,6 @@ class IosDeviceDiscovery implements DeviceDiscovery { ...@@ -407,7 +407,6 @@ class IosDeviceDiscovery implements DeviceDiscovery {
@override @override
Future<void> performPreflightTasks() async { Future<void> performPreflightTasks() async {
// Currently we do not have preflight tasks for iOS. // Currently we do not have preflight tasks for iOS.
return null;
} }
} }
......
...@@ -34,7 +34,7 @@ class UpdaterState extends State<Updater> { ...@@ -34,7 +34,7 @@ class UpdaterState extends State<Updater> {
// Only prompt once a day // Only prompt once a day
if (_lastUpdateCheck != null && if (_lastUpdateCheck != null &&
DateTime.now().difference(_lastUpdateCheck) < const Duration(days: 1)) { DateTime.now().difference(_lastUpdateCheck) < const Duration(days: 1)) {
return null; // We already checked for updates recently return; // We already checked for updates recently
} }
_lastUpdateCheck = DateTime.now(); _lastUpdateCheck = DateTime.now();
......
...@@ -931,7 +931,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager { ...@@ -931,7 +931,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager {
@override @override
void createChild(int index, { @required RenderBox after }) { void createChild(int index, { @required RenderBox after }) {
if (index < 0 || index >= children.length) if (index < 0 || index >= children.length)
return null; return;
try { try {
_currentlyUpdatingChildIndex = index; _currentlyUpdatingChildIndex = index;
_renderObject.insert(children[index], after: after); _renderObject.insert(children[index], after: after);
......
...@@ -27,7 +27,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager { ...@@ -27,7 +27,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager {
@override @override
void createChild(int index, { @required RenderBox after }) { void createChild(int index, { @required RenderBox after }) {
if (index < 0 || index >= children.length) if (index < 0 || index >= children.length)
return null; return;
try { try {
_currentlyUpdatingChildIndex = index; _currentlyUpdatingChildIndex = index;
_renderObject.insert(children[index], after: after); _renderObject.insert(children[index], after: after);
......
...@@ -568,7 +568,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase ...@@ -568,7 +568,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
assert(inTest); assert(inTest);
asyncBarrier(); // When using AutomatedTestWidgetsFlutterBinding, this flushes the microtasks. asyncBarrier(); // When using AutomatedTestWidgetsFlutterBinding, this flushes the microtasks.
return null;
} }
void _verifyInvariants() { void _verifyInvariants() {
......
...@@ -40,7 +40,6 @@ Future<void> writeFile(libfs.File outputFile, DevFSContent content) async { ...@@ -40,7 +40,6 @@ Future<void> writeFile(libfs.File outputFile, DevFSContent content) async {
outputFile.createSync(recursive: true); outputFile.createSync(recursive: true);
final List<int> data = await content.contentsAsBytes(); final List<int> data = await content.contentsAsBytes();
outputFile.writeAsBytesSync(data); outputFile.writeAsBytesSync(data);
return null;
} }
Future<void> run(List<String> args) async { Future<void> run(List<String> args) async {
......
...@@ -72,7 +72,7 @@ class Cache { ...@@ -72,7 +72,7 @@ class Cache {
/// calling [Cache.releaseLockEarly] once they are no longer touching the cache. /// calling [Cache.releaseLockEarly] once they are no longer touching the cache.
static Future<void> lock() async { static Future<void> lock() async {
if (!_lockEnabled) if (!_lockEnabled)
return null; return;
assert(_lock == null); assert(_lock == null);
_lock = await fs.file(fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile')).open(mode: FileMode.write); _lock = await fs.file(fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile')).open(mode: FileMode.write);
bool locked = false; bool locked = false;
...@@ -201,7 +201,7 @@ class Cache { ...@@ -201,7 +201,7 @@ class Cache {
Future<void> updateAll() async { Future<void> updateAll() async {
if (!_lockEnabled) if (!_lockEnabled)
return null; return;
try { try {
for (CachedArtifact artifact in _artifacts) { for (CachedArtifact artifact in _artifacts) {
if (!artifact.isUpToDate()) if (!artifact.isUpToDate())
......
...@@ -87,7 +87,7 @@ class CrashReportSender { ...@@ -87,7 +87,7 @@ class CrashReportSender {
}) async { }) async {
try { try {
if (_usage.suppressAnalytics) if (_usage.suppressAnalytics)
return null; return;
printStatus('Sending crash report to Google.'); printStatus('Sending crash report to Google.');
......
...@@ -579,7 +579,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { ...@@ -579,7 +579,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
Future<void> unforward(ForwardedPort forwardedPort) async { Future<void> unforward(ForwardedPort forwardedPort) async {
if (!_forwardedPorts.remove(forwardedPort)) { if (!_forwardedPorts.remove(forwardedPort)) {
// Not in list. Nothing to remove. // Not in list. Nothing to remove.
return null; return;
} }
printTrace('Unforwarding port $forwardedPort'); printTrace('Unforwarding port $forwardedPort');
...@@ -591,7 +591,5 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { ...@@ -591,7 +591,5 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
} else { } else {
printError('Forwarded port did not have a valid process'); printError('Forwarded port did not have a valid process');
} }
return null;
} }
} }
...@@ -109,7 +109,7 @@ class ColdRunner extends ResidentRunner { ...@@ -109,7 +109,7 @@ class ColdRunner extends ResidentRunner {
} }
@override @override
Future<void> handleTerminalCommand(String code) async => null; Future<void> handleTerminalCommand(String code) async { }
@override @override
Future<void> cleanupAfterSignal() async { Future<void> cleanupAfterSignal() async {
......
...@@ -278,10 +278,10 @@ class MemoryIOSink implements IOSink { ...@@ -278,10 +278,10 @@ class MemoryIOSink implements IOSink {
Future<void> get done => close(); Future<void> get done => close();
@override @override
Future<void> close() async => null; Future<void> close() async { }
@override @override
Future<void> flush() async => null; Future<void> flush() async { }
} }
/// A Stdio that collects stdout and supports simulated stdin. /// A Stdio that collects stdout and supports simulated stdin.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment