Skip to content

Commit ea97917

Browse files
docs: Update docs/HANDLED_RULES.md (#1034)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 036c965 commit ea97917

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/HANDLED_RULES.md

+11
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,17 @@ Example repair where a variable declared in a loop header is unused:
717717
}
718718
```
719719

720+
We also perform repair for unused variables in enhanced for-loop headers:
721+
722+
```diff
723+
- for (String input : inputList) { // noncompliant
724+
+ for (int inputIterator=0; inputIterator < inputList.size(); ++inputIterator) { // compliant
725+
doSomething();
726+
}
727+
```
728+
729+
> Note that this repair strategy is not suggested by SonarSource.
730+
720731

721732
-----
722733

0 commit comments

Comments
 (0)