Skip to content

v0.2.1 - Fix False Positives (W015, W017)

Choose a tag to compare

@calionauta calionauta released this 06 Mar 19:32

πŸ› Bug Fixes

W017 (Computed Signal) β€” Eliminate False Positives

Problem: Checker was flagging variable references as 'computed signals'

Before (❌ false positives):

Signal('x', todo['id'])    # ❌ W017 (not computed, just dict lookup)
Signal('y', count)         # ❌ W017 (not computed, just variable)
Signal('z', user.name)     # ❌ W017 (not computed, just attribute)

After (βœ… only real computed expressions):

Signal('x', todo['id'])    # βœ… OK (Subscript)
Signal('y', count)         # βœ… OK (Name)
Signal('total', a * b)     # ⚠️ W017 (BinOp - real computed!)
Signal('valid', all(a,b))  # ⚠️ W017 (Call - real computed!)
Signal('not', ~visible)    # ⚠️ W017 (UnaryOp - real computed!)

W015 (delete confirmation) β€” Pattern Matching

Problem: Checker flagged delete() even inside confirmation dialogs

Now skips warning when line contains:

  • AlertDialog or alert_dialog
  • confirm

Examples:

AlertDialogAction('Delete', action=delete('/x'))  # βœ… OK (has AlertDialog)
confirm('Sure?').then(delete('/y'))               # βœ… OK (has confirm)
Button('Delete', data_on_click=delete('/z'))      # ⚠️ W015 (no confirmation)

Message improved:

Before: 'ensure user confirmation UX exists'
After: 'verify confirmation UX exists (AlertDialog, confirm dialog, etc.)'

πŸ“Š Impact

Warning Before After
W017 false positives 4 in typical todo app 0 βœ…
W015 false positives 2 in typical todo app 0 βœ…
Real detections βœ… Detects computed βœ… Still detects
Real detections βœ… Detects unsafe delete βœ… Still detects

πŸ“¦ Installation

# Update existing install
starhtml-check --update

# Or fresh install
curl -L https://raw.githubusercontent.com/renatocaliari/starhtml-skill/main/starhtml_check.py \
  -o /usr/local/bin/starhtml-check && chmod +x /usr/local/bin/starhtml-check

Full changelog: v0.2.0...v0.2.1