Repository navigation
fix(diagnostics): re-lint open files on each scan; read nested DOL007 loop heads - #118
Merged
FROWNINGdev merged 1 commit intoSep 27, 2026
Merged
Conversation
… loop heads
Files open when VS Code starts were linted before the first workspace scan
finished and never again, so DOL008 and the schema gates of DOL007 stayed
silent until the user typed in them; a models.py edit likewise never
reached views already open. registerCodeFixes now takes an index-changed
event and re-lints every open document when it fires.
DOL007's loop-head regex allowed only flat argument lists and no call after
the first, so for o in Order.objects.filter(created__lte=timezone.now()):
and for o in Order.objects.filter(...).order_by("-id"): were never
inspected. The head is now parsed with balanced parentheses across the
whole chain, skipping string literals.
|
Warning Review limit reachedNext included review available in 49 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FROWNINGdev
deleted the
fix/schema-rules-cold-start-and-nested-loop-heads
branch
September 27, 2026 20:23
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two gaps found while capturing a demo of 0.19.0 on a five-model shop project:
stauts="paid"(DOL008) andorder.customer.emailinside a date-bounded loop (DOL007) were not flagged in the editor, while the CLI reported the N+1.1. Schema-aware rules silent in files open at startup. Documents open at activation are linted before the first scan finishes, and nothing re-lints them once the index arrives.
registerCodeFixesnow takes anonIndexChangedevent (fired fromdoScan) and re-lints every open document. This also carries amodels.pyedit into diagnostics of views already open.2. DOL007 skipped common loop heads.
RE_FOR_LOOP_HEADaccepted only flat argument lists and no call after the first, sofilter(created__lte=timezone.now())andfilter(...).order_by("-id")never reached the rule. Replaced with a small balanced-paren parser over the call chain that skips string literals.Tests: three new DOL007 cases (nested call, chained call,
select_relatedlater in the chain with a)inside a string). Full suite: 257/257.