Skip to content

Commit

Permalink
Handle missing separator in rule id
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp committed Jan 28, 2025
1 parent e86e05b commit c6babde
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public class RubocopCategorizer implements RuleCategorizer {

@Override
public String categorizeRule(ReportingDescriptor rule) {
return rule.id().substring(0, rule.id().indexOf('/'));
int separatorIndex = rule.id().indexOf('/');
if (separatorIndex == -1) {
return rule.id();
}
return rule.id().substring(0, separatorIndex);
}
}

0 comments on commit c6babde

Please sign in to comment.