From 2d26af5934c411dd9c5a10f3cf62eddeff9c9cc7 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 6 May 2026 23:46:36 +0200 Subject: [PATCH] suppress POSIX-shaped lint hits in libc FFI bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lib/src/pty/ffi/libc.dart` carried 34 analyze infos: - 26 × `non_constant_identifier_names` on struct field names (`msg_name`, `iov_base`, `msg_controllen`, etc.) that map 1:1 to POSIX (`man 2 socketpair`, `recvmsg`, `iovec`, `msghdr`). - 8 × `library_private_types_in_public_api` on the C / Dart function-signature typedefs (`_SocketpairC`, `_SocketpairDart`, etc.) consumed only by the `lookupFunction<...>()` calls in this same file. Renaming the field names to lowerCamelCase would diverge from the spec the file documents itself against; promoting the typedefs to public would just add noise to the import surface. This is the textbook FFI-binding case where the lints work against the file's purpose. Adds a file-wide `// ignore_for_file:` directive — explicitly approved per the no-lint-suppression rule, with the reason written inline above the directive so a future reader can re-evaluate it. Project analyze drops 65 → 31 issues. Co-Authored-By: Claude --- .pql/pql-plan.json | 2 +- lib/src/pty/ffi/libc.dart | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.pql/pql-plan.json b/.pql/pql-plan.json index 7b83a344..c56efac1 100644 --- a/.pql/pql-plan.json +++ b/.pql/pql-plan.json @@ -1,5 +1,5 @@ { - "exported_at": "2026-05-06T21:46:24Z", + "exported_at": "2026-05-06T21:46:36Z", "decisions": [ { "id": "D-1", diff --git a/lib/src/pty/ffi/libc.dart b/lib/src/pty/ffi/libc.dart index 0063a868..0985d801 100644 --- a/lib/src/pty/ffi/libc.dart +++ b/lib/src/pty/ffi/libc.dart @@ -10,6 +10,24 @@ /// set against the Win32 API (named pipes instead of unix sockets). library; +// File-wide analyzer exceptions, with reason — see CLAUDE.md +// no-lint-suppression rule. These are the textbook FFI-binding +// case where the lints work against the file's purpose: +// +// * `non_constant_identifier_names` — struct field names map 1:1 +// to POSIX (`man 2 socketpair`, `recvmsg`, `iovec`, `msghdr`). +// Keeping snake_case makes the code greppable against the spec +// and the field offsets readable next to the C ABI. Dart FFI +// layout depends on declaration order + types, not names, so +// this is purely a readability call. +// * `library_private_types_in_public_api` — the C / Dart function- +// signature typedefs (`_SocketpairC`, `_SocketpairDart`, etc.) +// are implementation details consumed only by the public +// `lookupFunction<...>()` calls in this file. Promoting them +// to public would just add noise to the import surface. +// +// ignore_for_file: non_constant_identifier_names, library_private_types_in_public_api + import 'dart:ffi' as ffi; import 'dart:io' show Platform;