Skip to content

chore(mobile,plugin): adopt very_good_analysis lint preset - #70

Merged
cafca merged 2 commits into
mainfrom
claude/zealous-hertz-136862
Apr 25, 2026
Merged

chore(mobile,plugin): adopt very_good_analysis lint preset#70
cafca merged 2 commits into
mainfrom
claude/zealous-hertz-136862

Conversation

@cafca

@cafca cafca commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Swap flutter_lintsvery_good_analysis in mobile app, ferrostar_flutter plugin, and plugin example
  • Plugin treated as a published library: public_member_api_docs enforced — every public class/method/field gets a /// doc
  • Mobile + example disable public_member_api_docs (apps, not libs) and lines_longer_than_80_chars (dart format is authoritative)

Lint cleanup

flutter analyze is now 0 issues across all three packages.

Package Before After
mobile 648 0
ferrostar_flutter 102 0
example 7 0

Roughly 509 lints fixed in total: ~509 from dart fix --apply, ~314 by hand. Substantive changes (not just style):

  • inference_failure_* — added explicit type args to all Dio calls (<dynamic> since responses navigate .data); explicit generics on collection literals and Future.delayed/MaterialPageRoute/etc.
  • unawaited_futures / discarded_futures — wrapped fire-and-forget calls with unawaited(); converted some sites to async/await where propagation was correct
  • avoid_catches_without_on_clausescatch (e)on Object catch (e) (semantically identical, lint-explicit)
  • avoid_dynamic_calls — added as Map<String, dynamic> casts before key access
  • cascade_invocations — rewrote repeated-receiver call sequences as cascade chains
  • avoid_positional_boolean_parametersSetWakelock typedef now takes a named enabled: param; setDimmed(controller, enabled:) updated
  • Plugin docs — wrote /// docs on every public symbol in lib/src/ (controller, exceptions, platform interface, method-channel platform, 8 freezed models)
  • unintended_html_in_doc_comment — escaped <...> in doc comments using backticks
  • pubspec.yaml — sorted dependencies alphabetically in all three packages

Test plan

  • flutter analyze clean in mobile, plugin, example
  • just test-mobile — 177/177 pass
  • just test-ferrostar-flutter-plugin — 21/21 pass
  • plugin example — 1/1 pass
  • CI green

cafca added 2 commits April 25, 2026 15:24
Replace flutter_lints with very_good_analysis across mobile app,
ferrostar_flutter plugin, and example. Plugin treated as a published
library (public_member_api_docs enforced); mobile and example disable
docs lint and lines_longer_than_80_chars (dart format is authoritative).

Fixes 0 → 0 issues across all three packages. ~509 lints fixed:
- 454 auto-fixed by dart fix --apply in mobile
- 55 auto-fixed in plugin
- ~219 manual fixes in mobile (Dio type args, unawaited/discarded
  futures, on Object catches, cascade rewrites, dynamic casts, etc.)
- ~95 manual fixes in plugin + example (full public API doc comments,
  pubspec sorting, escaped html in doc comments, line breaks)

All tests pass: 177/177 mobile, 21/21 plugin, 1/1 example.
…136862

# Conflicts:
#	mobile/lib/models/user.dart
#	mobile/lib/providers/route_provider.dart
#	mobile/lib/screens/map_screen.dart
#	mobile/lib/widgets/map/route_sheet.dart
@cafca
cafca merged commit a578393 into main Apr 25, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant