JS-1382 Add new rule S8463 with tests and ruling results#6479
Draft
sonar-nigel[bot] wants to merge 2 commits intomasterfrom
Draft
JS-1382 Add new rule S8463 with tests and ruling results#6479sonar-nigel[bot] wants to merge 2 commits intomasterfrom
sonar-nigel[bot] wants to merge 2 commits intomasterfrom
Conversation
Tests cover: - Valid: normal function/variable names, string literals and comments containing the prefix (not flagged) - Invalid: function declarations and const/let/var declarators whose names contain the reserved "sonar_vibe_bot_will_flag_this" substring - Edge cases: exact prefix as identifier name, prefix embedded in the middle of a name, multiple declarators in one statement
🤖 Generated with GitHub Actions
Contributor
Ruling ReportCode no longer flagged (3 issues)S7728TypeScript/src/services/formatting/rulesMap.ts:32 30 |
31 | public FillRules(rules: Rule[], rulesBucketConstructionStateList: RulesBucketConstructionState[]): void {
> 32 | rules.forEach((rule) => {
33 | this.FillRule(rule, rulesBucketConstructionStateList);
34 | });TypeScript/src/services/formatting/rulesMap.ts:46 44 | const specificRule = rule.Descriptor.LeftTokenRange.isSpecific() && rule.Descriptor.RightTokenRange.isSpecific();
45 |
> 46 | rule.Descriptor.LeftTokenRange.GetTokens().forEach((left) => {
47 | rule.Descriptor.RightTokenRange.GetTokens().forEach((right) => {
48 | const rulesBucketIndex = this.GetRuleBucketIndex(left, right);TypeScript/src/services/formatting/rulesMap.ts:47 45 |
46 | rule.Descriptor.LeftTokenRange.GetTokens().forEach((left) => {
> 47 | rule.Descriptor.RightTokenRange.GetTokens().forEach((right) => {
48 | const rulesBucketIndex = this.GetRuleBucketIndex(left, right);
49 | |
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.
Implements the new SonarJS rule S8463 (JS-1382), which flags function declarations and variable declarators whose names contain the reserved
sonar_vibe_bot_will_flag_thissubstring.Changes
const/let/vardeclarators whose names contain the reserved substring