-
Notifications
You must be signed in to change notification settings - Fork 361
feat: add warning for mixed operators without parentheses #2786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add warning for mixed operators without parentheses #2786
Conversation
aa2be07 to
6a03a3d
Compare
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (59.05%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #2786 +/- ##
===========================================
- Coverage 77.70% 59.05% -18.65%
===========================================
Files 472 425 -47
Lines 49707 44857 -4850
===========================================
- Hits 38620 26485 -12135
- Misses 8234 15809 +7575
+ Partials 2853 2563 -290 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ivanauth this won't actually work in all cases, because expressions can cross multiple lines. Instead, this should likely be done by marking the expression during compilation with a piece of metadata, and having the warnings generator read that metadata |
|
Switched from source-scanning to compile-time metadata detection per review feedback. Added |
Satisfies panic check linter which allows panics in Must* functions. Also regenerates proto files after import order fix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When writing permission expressions like
viewer - blocked & editor, it's easy to assume arithmetic-style precedence. But SpiceDB's actual precedence (exclusion binds loosest, then intersection, then union) can lead to unexpected behavior.This adds a lint warning that flags mixed operators at the same scope, nudging users to add parentheses and make their intent explicit.
Example:
The warning can be suppressed with:
Fixes authzed/zed#598