suppress POSIX-shaped lint hits in libc FFI bindings
`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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"exported_at": "2026-05-06T21:46:24Z",
|
||||
"exported_at": "2026-05-06T21:46:36Z",
|
||||
"decisions": [
|
||||
{
|
||||
"id": "D-1",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user