Repository navigation
Release v17.0.1-beta.7
Pre-release
Pre-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/.singleaccess 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 flagsDateFormat.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 storedDateFormatthat is not formatted at the construction site.require_ios_push_notification_capability: no longer flagsrequestPermission()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 flagsStringBuffer.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.enabledoff 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. scancommand:dart run saropa_lints scannow 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 sametrylogs 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-stylegroup.addAll(...)). A single-collection loop, including one that mutates a different list, is still flagged.avoid_unsafe_collection_methods: no longer flagsxs!.firstwhen 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 flagsparts.firstwherepartsis a local initialized froms.split(...)(always non-empty). A guard on a different collection, or no guard, is still flagged.avoid_string_substring: no longer flagss.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 flagsreturn await dbWrite(...)inside the body of atrythat has acatchclause or afinallyblock, where theawaitis required for the handler to see the async error. Returns outside a guarded try body (including inside thecatchitself) are still flagged.avoid_retaining_disposed_widgets: no longer flags a non-staticWidget/State/BuildContextfield (orListof them) that the same class'sdispose()assignsnull(_ghost = null/this._cards = null). Fieldsdispose()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 givesnullits 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 resolvesnullwithx ??= fallbackorx ?? fallback(null is a distinct input, same as the existing== null/!= nullexemption). Parameters whose body never acts onnullare still flagged.avoid_nullable_interpolation: no longer flags an interpolation guarded byx != 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 flagsFadeTransition/SlideTransition/ScaleTransition/RotationTransitioninside a class that already readsdisableAnimations/accessibleNavigation, or calls a reduced-motion orsettlehelper to settle the controller (matched as identifiers, so comments and words likesettlementdo 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 areandroid/and/orios/(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 flagslist[0]/list[1]in a loop when the same list'slengthis checked first, in the left side of&&, in an enclosingifor ternary, or in an earlierif (...) 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 < nin a then-branch, and accesses with no length check, are still flagged.