riverpod-3-scanner 1.13.1
“Comprehensive static analysis tool for detecting Riverpod 3.0 async safety violations in Flutter/Dart projects”
imports Path from pathlibimports os
SHA-256605ca90ea014adde400bf694f23eba00f2cf5111c74833b88090f376b426b11f
MaleculeH₂(Db₂F)
Evidence
270 line_number=abs_getter_line,
271 context=f"DEADLY: Direct lazy getter 'get {getter_name} => ref.read()' in async class - will crash on widget unmount",
272 code_snippet=snippet,
273 fix_instructions=f"""CRITICAL: This lazy getter caused production crash (Sentry issue #7055596134)
2141Reference: https://github.com/DayLight-Creative-Technologies/riverpod_3_scanner/blob/main/docs/GUIDE.md
2142SSK Async-Surface Taxonomy: .claude/rules/presentation-layer.md
2143Sentry Issue: SOCIALSCOREKEEPER-FLUTTER-9CJ""",
2144 ),
1#!/usr/bin/env python3
2"""
3Riverpod 3.0 Safety Scanner
4Comprehensive static analysis tool for Flutter/Dart projects using Riverpod 3.0+
5
6Author: Steven Day
7Company: DayLight Creative Technologies
8License: MIT
9
10Detects ALL forbidden patterns that violate Riverpod 3.0 async safety standards.
11
12SCANS FOUR CLASS TYPES (plus two file-scope surfa …
66:27… // After await
67 logger.logInfo('Done');
68 }
69
70Reference: https://github.com/DayLight-Creative-Technologies/riverpod_3_scanner/blob/main/docs/GUIDE.md
71"""
72
73import argparse
74import json
75import os
76import sys
77from pathlib import Path
78from typing import List, Optional, Set
79
80from . import __version__
81from .models import Violation, ViolationType
82from .utils import (
83 FileCache,
84 find_matching_brace,
85 find_async_methods,
86 is_line_suppressed,
87 is_file_suppressed,
88 RE_PROVIDER_CLASS,
89 RE_CONSUMER_STATE_CLASS,
90 RE_CONSUMER_WIDGET_CLASS,
91 RE_HOOK_CONSUMER_WIDGET_CLASS,
92)
93from .analysis import AnalysisContext, run_all_passes
94from .checkers import (
95 CheckContext,
96 check_field_caching,
97 check_async_method_safety,
98 check_sync_methods_without_mounted,
99 check_nullable_field_misuse,
100 check_ref_in_lifecycle_callbacks,
101 check_ref_operations_outside_build,
102 check_widget_lifecycle_unsafe_ref,
103 check_deferred_callbacks,
104 check_async_event_handlers,
105 check_untyped_lazy_getters,
106 check_mounted_confusion,
107 check_initstate_field_access,
108 check_ref_into_plain_class,
109 check_async_star_function_providers,
110 check_build_listen_sync_state_mutation,
111)
112from .output import format_violation_text, print_summary_text, format_json
113
355:18… ressed_count = 0
356
357 dart_files = [
358 f for f in directory.glob(pattern)
359 if f.is_file()
360 and not str(f).endswith('.g.dart')
361 and not str(f).endswith('.freeze …
No evidence locations were recorded for this file. Raw result