-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Summary
Add linter rules to validate balanced parentheses (), square brackets [], and curly braces {} in formulas.
Motivation
Commit c222245 introduced a syntax error (missing closing parenthesis) that passed linting but caused "Formula parse error" in Google Sheets. A balance check would have caught this immediately.
Requirements
- Check balance of all three bracket types:
(),[],{} - Handle string literals correctly - ignore brackets inside quoted strings
- Provide clear error messages with position information
- Run as part of existing linter workflow
Implementation Notes
- Add new
BalancedBracketsRuleclass toscripts/lint_formulas.py - Parse formula to identify string boundaries before checking balance
- Consider using simple state machine or regex for string detection
Reference
- Fixed in: Fix DENSIFY formula syntax error - missing closing parentheses #85
- Introduced in: c222245