fix: warn on interval_modifier typo#754
Merged
DjamilaBaroudi merged 1 commit intoMay 22, 2026
Merged
Conversation
The validator only matched the exact plural form, so common typos like "interval_modifier" (singular) were silently dropped by the CLI with no diagnostic. Emit a warning suggesting the correct key. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/language-server/providers/materializationValidator.ts:142-143
Dead guard — `typoMatch[2]` can never equal `'interval_modifiers'` because that string is not an alternative in the regex. The first branch is `interval_modifier` (no trailing `s`), so the `!== 'interval_modifiers'` check is always `true` and never filters anything. If the intent was to also match the singular and then skip the exact correct form, the first alternative should have been `interval_modifiers?` (with `?` making the `s` optional), paired with the existing guard to suppress warnings for the correct spelling.
```suggestion
const typoMatch = line.match(/^(\s*)(interval_modifiers?|intervalmodifiers?|interval-modifiers?)\s*:/i);
if (typoMatch && typoMatch[2].toLowerCase() !== 'interval_modifiers') {
```
Reviews (1): Last reviewed commit: "flag misspellings of interval_modifiers ..." | Re-trigger Greptile |
Comment on lines
+142
to
+143
| const typoMatch = line.match(/^(\s*)(interval_modifier|intervalmodifiers?|interval-modifiers?)\s*:/i); | ||
| if (typoMatch && typoMatch[2] !== 'interval_modifiers') { |
There was a problem hiding this comment.
Dead guard —
typoMatch[2] can never equal 'interval_modifiers' because that string is not an alternative in the regex. The first branch is interval_modifier (no trailing s), so the !== 'interval_modifiers' check is always true and never filters anything. If the intent was to also match the singular and then skip the exact correct form, the first alternative should have been interval_modifiers? (with ? making the s optional), paired with the existing guard to suppress warnings for the correct spelling.
Suggested change
| const typoMatch = line.match(/^(\s*)(interval_modifier|intervalmodifiers?|interval-modifiers?)\s*:/i); | |
| if (typoMatch && typoMatch[2] !== 'interval_modifiers') { | |
| const typoMatch = line.match(/^(\s*)(interval_modifiers?|intervalmodifiers?|interval-modifiers?)\s*:/i); | |
| if (typoMatch && typoMatch[2].toLowerCase() !== 'interval_modifiers') { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/language-server/providers/materializationValidator.ts
Line: 142-143
Comment:
Dead guard — `typoMatch[2]` can never equal `'interval_modifiers'` because that string is not an alternative in the regex. The first branch is `interval_modifier` (no trailing `s`), so the `!== 'interval_modifiers'` check is always `true` and never filters anything. If the intent was to also match the singular and then skip the exact correct form, the first alternative should have been `interval_modifiers?` (with `?` making the `s` optional), paired with the existing guard to suppress warnings for the correct spelling.
```suggestion
const typoMatch = line.match(/^(\s*)(interval_modifiers?|intervalmodifiers?|interval-modifiers?)\s*:/i);
if (typoMatch && typoMatch[2].toLowerCase() !== 'interval_modifiers') {
```
How can I resolve this? If you propose a fix, please make it concise.
terzioglub
approved these changes
May 21, 2026
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.
Summary
interval_modifiers:, so common typos like the singularinterval_modifier:were silently dropped by the CLI with no diagnostic.materializationValidator.tsthat flagsinterval_modifier,intervalmodifier(s), andinterval-modifier(s)with a warning suggesting the correct key.Closes BRU-3764.
Test plan
interval_modifier:(singular) at top level — expect a yellow squiggle with "Unknown key 'interval_modifier'. Did you mean 'interval_modifiers'?"interval_modifier:inside a@bruinblock — same warning appears.interval_modifiers:produces no false positive.🤖 Generated with Claude Code