Prefer single quotes (as per Flutter style guide).

This commit is contained in:
Dain Nilsson 2021-11-19 11:20:57 +01:00
parent dd6a3e84c8
commit 9817220256
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
7 changed files with 25 additions and 19 deletions

View File

@ -29,7 +29,9 @@ jobs:
- run: flutter --version
- name: Run tests
run: flutter test
run: |
flutter test
flutter analyze
- name: Install ykman
run: ./build-ykman.sh

View File

@ -29,7 +29,9 @@ jobs:
- run: flutter --version
- name: Run tests
run: flutter test
run: |
flutter test
flutter analyze
- name: Install ykman
run: ./build-ykman.sh

View File

@ -28,7 +28,9 @@ jobs:
- run: flutter --version
- name: Run tests
run: flutter test
run: |
flutter test
flutter analyze
- name: Install ykman
run: .\build-ykman.bat

View File

@ -23,7 +23,7 @@ linter:
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@ -16,7 +16,7 @@ class Version with _$Version {
@override
String toString() {
return "$major.$minor.$patch";
return '$major.$minor.$patch';
}
}

View File

@ -15,9 +15,9 @@ class Signaler {
void cancel() {
final sendSignal = _sendSignal;
if (sendSignal == null) {
throw Exception("Signaler not attached to any request!");
throw Exception('Signaler not attached to any request!');
}
sendSignal("cancel");
sendSignal('cancel');
}
}
@ -31,10 +31,10 @@ class _Request {
_Request(this.action, this.target, this.body, this.signal);
Map<String, dynamic> toJson() => {
"kind": "command",
"action": action,
"target": target,
"body": body,
'kind': 'command',
'action': action,
'target': target,
'body': body,
};
}
@ -52,12 +52,12 @@ class RpcSession {
.cast<Map<String, dynamic>>()
.listen(null) {
stderr.addStream(_process.stderr);
developer.log("Launched ykman subprocess...", name: "rpc");
developer.log('Launched ykman subprocess...', name: 'rpc');
}
static Future<RpcSession> launch(String executable) async {
var process =
await Process.start(executable, [], environment: {"_YKMAN_RPC": "1"});
await Process.start(executable, [], environment: {'_YKMAN_RPC': '1'});
return RpcSession(process);
}
@ -77,7 +77,7 @@ class RpcSession {
request.signal?._sendSignal = _sendSignal;
responses.onData((data) {
developer.log("RECV", name: "rpc", error: jsonEncode(data));
developer.log('RECV', name: 'rpc', error: jsonEncode(data));
try {
final response = RpcResponse.fromJson(data);
if (response.map(
@ -101,8 +101,8 @@ class RpcSession {
pump();
}
} catch (e) {
developer.log("Invalid RPC message",
name: "rpc", error: jsonEncode(e));
developer.log('Invalid RPC message',
name: 'rpc', error: jsonEncode(e));
}
});
@ -111,11 +111,11 @@ class RpcSession {
}
void _sendSignal(String status) {
_send({"kind": "signal", "status": status});
_send({'kind': 'signal', 'status': status});
}
void _send(Map data) {
developer.log("SEND", name: "rpc", error: jsonEncode(data));
developer.log('SEND', name: 'rpc', error: jsonEncode(data));
_process.stdin.writeln(jsonEncode(data));
_process.stdin.flush();
}

View File

@ -30,7 +30,7 @@ class RpcNodeSession {
signal: signal,
);
} on RpcError catch (e) {
if (e.status == "state-reset") {
if (e.status == 'state-reset') {
_reset();
}
rethrow;