Skip to content

Commit

Permalink
Apply 193 (#197)
Browse files Browse the repository at this point in the history
fixes #193
  • Loading branch information
rrousselGit authored Oct 20, 2023
1 parent e8941b7 commit 37fe9b1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/custom_lint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improve the command line's output (thanks to @kuhnroyal)
- Update uuid to 4.0.0
- Fixed a port leak
- Fix connection issues on Docker/windows (thanks to @hamsbrar)

## 0.5.3 - 2023-08-29

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class SocketCustomLintServerToClientChannel {
[
if (_server.watchMode) '--enable-vm-service=${await port}',
join('lib', 'custom_lint_client.dart'),
_serverSocket.address.host,
_serverSocket.port.toString(),
],
workingDirectory: tempDir.path,
Expand Down Expand Up @@ -213,10 +214,12 @@ import 'package:custom_lint_builder/src/channel.dart';
$imports
void main(List<String> args) async {
final port = int.parse(args.single);
final host = args[0];
final port = int.parse(args[1]);
runSocket(
port: port,
host: host,
includeBuiltInLints: ${_server.includeBuiltInLints},
{$plugins},
);
Expand Down
4 changes: 2 additions & 2 deletions packages/custom_lint/test/cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ invalid;
^^^^^^^
'''),
matchIgnoringAnsi(contains, '''
lib/custom_lint_client.dart:13:29: Error: Undefined name 'createPlugin'.
lib/custom_lint_client.dart:15:29: Error: Undefined name 'createPlugin'.
{'test_lint': test_lint.createPlugin,
^^^^^^^^^^^^
'''),
Expand Down Expand Up @@ -296,7 +296,7 @@ int x = 'oy';
^
'''),
matchIgnoringAnsi(contains, '''
lib/custom_lint_client.dart:15:26: Error: Undefined name 'createPlugin'.
lib/custom_lint_client.dart:17:26: Error: Undefined name 'createPlugin'.
'test_lint2': test_lint2.createPlugin,
^^^^^^^^^^^^
'''),
Expand Down
3 changes: 2 additions & 1 deletion packages/custom_lint_builder/lib/src/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ typedef CreatePluginMain = PluginBase Function();
Future<void> runSocket(
Map<String, CreatePluginMain> pluginMains, {
required int port,
required String host,
required bool includeBuiltInLints,
}) async {
late Future<CustomLintPluginClient> client;

await asyncRunZonedGuarded(
() => client = Future(() async {
// ignore: close_sinks, connection stays open until the plugin is killed
final socket = await Socket.connect(InternetAddress.loopbackIPv6, port);
final socket = await Socket.connect(host, port);
final socketChannel = JsonSocketChannel(Future.value(socket));
final registeredPlugins = <String, PluginBase>{};

Expand Down

1 comment on commit 37fe9b1

@vercel
Copy link

@vercel vercel bot commented on 37fe9b1 Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.