Repository navigation
fix: false positives after definitions in no-missing-label-refs - #757
lumirlumir wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Track definitions and validate unfinished references src/rules/no-missing-label-refs.js, tests/rules/no-missing-label-refs.test.js |
The definition handler adds each identifier to allowLabels. Tests cover unfinished references after a definition and on both sides of a definition. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 66b50
-
The change addresses the reported false positive without introducing a concrete merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: fixing false positives after definitions in the no-missing-label-refs rule. The raw summary confirms the change adds a label definition identifier to allowLabels when the definition is visited, so later text nodes do not report that label as missing. The title is specific, uses a conventional commit prefix, and matches the PR objectives, which describe a missed reference reported after a definition.
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
Which language are you using?
commonmark & gfm
What did you do?
What did you expect to happen?
No error because
foois defined.What actually happened?
The rule incorrectly reports
Label reference 'foo' not found.Moving the definition below the reference avoids the error.markdown/tests/rules/no-missing-label-refs.test.js
Line 48 in 502ddd9
What changes did you make? (Give an overview)
This PR fixes a false positive where a
definitionnode comes before reference-like text.The
definitionnode can appear before or after the reference-like text, so their order should not affect the result.However, the current rule processes nodes sequentially and only clears matching error candidates collected before the definition, so the following passes:
but the following produces a false positive:
Related Issues
N/A
Is there anything you'd like reviewers to focus on?
N/A
Summary by CodeRabbit