Skip to content

Release v17.0.1-beta.7

Pre-release
Pre-release

Choose a tag to compare

@saropa saropa released this 01 Nov 02:50
· 169 commits to main since this release

False-positive hardening for 15 lint rules; the master switch now stops the language server; scan exits 0 when disabled. log

Fixed

  • avoid_unsafe_collection_methods: a .first/.last/.single access is no longer flagged when the same line or the line directly above carries // non-empty: <reason> (the reason is required). Use it for lists that are non-empty by an API contract the rule cannot see; a marker with no reason is ignored.
  • require_timezone_display: no longer flags DateFormat.jm()/Hm()/Hms(...).format(local) (a time of day shown on the user's own device). Still flagged when the formatted value is visibly UTC (.toUtc(), DateTime.utc, isUtc) and for a stored DateFormat that is not formatted at the construction site.
  • require_ios_push_notification_capability: no longer flags requestPermission() on non-push receivers (Geolocator.requestPermission() and similar location/contacts/audio permission APIs). requestPermission() is flagged only when its receiver looks like messaging/notification/push (FirebaseMessaging.instance, messaging, fcm); getToken, onMessage, and the push class patterns are unchanged.
  • require_data_encryption: no longer flags StringBuffer.write(...) / StringSink.write(...) (an in-memory hash input, not storage), or a static call whose only sensitive-looking word is the receiver class's own name repeated as a leading qualifier (SuccessCardGate.write([SuccessCardGate.milestoneKey(id)]); Card.write([userCreditCard.number]) is still flagged). Real credentials in the payload are still flagged.
  • Master switch (extension): turning saropaLints.enabled off now also stops the standalone language server, even when its own setting is on, and turning it back on restarts it. Before, the server kept running and its findings stayed in the Problems panel after an "Off" toggle. Starting the server by command while the master switch is off now says why it did not start.
  • scan command: dart run saropa_lints scan now prints a "disabled" line and exits 0 when the VS Code extension has turned Lint integration off (plugin block commented out), instead of exiting 2 and failing every pre-commit hook. No action required; the README now has a "How to turn saropa_lints completely off" section.
  • require_catch_logging: no longer flags a typed catch (on _NoV1Rebuild { return null; }) when another catch clause of the same try logs or rethrows (on Object catch (e, st) { debugException(e, st); }). A typed catch whose sibling catches are also silent, a lone typed catch, and an empty typed catch, are still flagged.
  • prefer_asmap_over_indexed_iteration: no longer flags an index loop where the index also addresses a second collection (a[j] + b[j]), or where the body adds to / removes from the iterated list (BFS-style group.addAll(...)). A single-collection loop, including one that mutates a different list, is still flagged.
  • avoid_unsafe_collection_methods: no longer flags xs!.first when the guard is written null-aware on the same collection (xs?.length == 1 ? xs!.first : null, (xs?.isNotEmpty ?? false) ? xs!.first : null). Also no longer flags parts.first where parts is a local initialized from s.split(...) (always non-empty). A guard on a different collection, or no guard, is still flagged.
  • avoid_string_substring: no longer flags s.substring(...) on the right side of && when the left side checks the same string (s.startsWith('c') && s.substring(1) == 'x', s.length > 3 && ...) or the slice arguments. A guard on a different string, or no guard, is still flagged.
  • avoid_return_await_db: no longer flags return await dbWrite(...) inside the body of a try that has a catch clause or a finally block, where the await is required for the handler to see the async error. Returns outside a guarded try body (including inside the catch itself) are still flagged.
  • avoid_retaining_disposed_widgets: no longer flags a non-static Widget / State / BuildContext field (or List of them) that the same class's dispose() assigns null (_ghost = null / this._cards = null). Fields dispose() does not clear, and static fields, are still flagged.
  • avoid_nullable_parameters_with_default_values: no longer flags a nullable parameter with a default that the body forwards unchanged as an argument to a callee parameter that is itself nullable (query(isHidden: isHidden)); the callee gives null its meaning. Forwarding to a non-nullable parameter, or not forwarding directly, is still flagged.
  • avoid_nullable_parameters_with_default_values: no longer flags a nullable parameter with a default when the body resolves null with x ??= fallback or x ?? fallback (null is a distinct input, same as the existing == null / != null exemption). Parameters whose body never acts on null are still flagged.
  • avoid_nullable_interpolation: no longer flags an interpolation guarded by x != null && on its left (e.g. uuid != null && list.contains('${uuid}|$code')), or a null-aware chain off a receiver already checked non-null (if (x != null) '${x?.map(...).join()}'). Unguarded interpolations and || conditions are still flagged.
  • avoid_nested_assignments: no longer flags the grouping idiom (map[key] ??= <T>[]).add(item) (a parenthesized ??= on a map index used as a call, property or index target). Other nested assignments, including ??= on plain variables and = on an index, are still flagged.
  • avoid_motion_without_reduce: no longer flags FadeTransition / SlideTransition / ScaleTransition / RotationTransition inside a class that already reads disableAnimations / accessibleNavigation, or calls a reduced-motion or settle helper to settle the controller (matched as identifiers, so comments and words like settlement do not count). Transitions in classes with no such handling, and non-transition widgets, are still flagged.
  • avoid_forward_slash_path_assumption: no longer runs in a Flutter app whose only platform folders are android/ and/or ios/ (forward slash is correct there). Apps or packages that can run on Windows are still flagged.
  • avoid_duplicate_string_elements: no longer flags empty strings repeated in a list, lists passed as call or constructor arguments (fixed positional slots), or const lookup tables of 6+ elements indexed by position. Set literals and short plain lists with repeats are still flagged.
  • avoid_accessing_collections_by_constant_index: no longer flags list[0] / list[1] in a loop when the same list's length is checked first, in the left side of &&, in an enclosing if or ternary, or in an earlier if (...) continue/break/return/throw;, and the check implies a non-empty list (> 0, >= n, == n, != 0; or the reverse in an else-branch or early exit). length == 0 / length < n in a then-branch, and accesses with no length check, are still flagged.