Skip to content

Commit

Permalink
feat(Rules): key updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Grousset committed Mar 18, 2024
1 parent fa3edd0 commit 5f0afb8
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Check the use of "UIScreen.main.brightness" and triggers when set.
*/
@Rule(key = "ESOB007")
@Rule(key = "EC603")
public class AnimationFreeCheck extends SwiftRuleCheck {

private static final String DEFAULT_ISSUE_MESSAGE = "Usage of Animations must absolutely be avoided";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Check the use of "AVCaptureTorchMode.on", "setTorchModeOn(level: Float)", or "torchMode = .on" and triggers when set to true.
*/
@Rule(key = "EC23")
@Rule(key = "EC503")
public class TorchFreeCheck extends SwiftRuleCheck {
private static final String DEFAULT_ISSUE_MESSAGE = "Usage of `AVCaptureDevice#torchMode` or `AVCaptureDevice#setTorchModeOn(level:)` must absolutely be avoided";
@Override
Expand Down
26 changes: 0 additions & 26 deletions swift-lang/src/main/resources/io/ecocode/rules/swift/ESOB007.html

This file was deleted.

19 changes: 0 additions & 19 deletions swift-lang/src/main/resources/io/ecocode/rules/swift/ESOB007.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testRegisteredRules() {

@Test
public void assertRuleProperties() {
Rule rule = repository.rule("ESOB007");
Rule rule = repository.rule("EC603");
assertThat(rule).isNotNull();
assertThat(rule.name()).isEqualTo("Animation Methods in UIKit and SwiftUI");
assertThat(rule.debtRemediationFunction().type()).isEqualTo(Type.CONSTANT_ISSUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void assertAnimationFreeIssue(String file, int line) {
}

private void assertIssue(Issue issue, int line) {
assertThat(issue.ruleKey().rule()).isEqualTo("ESOB007");
assertThat(issue.ruleKey().rule()).isEqualTo("EC603");
assertThat(issue.ruleKey().repository()).isEqualTo("ecoCode-swift");
IssueLocation location = issue.primaryLocation();
assertThat(location.textRange().start().line()).isEqualTo(line);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void assertTorchIssue(String file, int line) {
}

private void assertIssue(Issue issue, int line) {
assertThat(issue.ruleKey().rule()).isEqualTo("EC23");
assertThat(issue.ruleKey().rule()).isEqualTo("EC503");
assertThat(issue.ruleKey().repository()).isEqualTo("ecoCode-swift");
IssueLocation location = issue.primaryLocation();
assertThat(location.textRange().start().line()).isEqualTo(line);
Expand Down

0 comments on commit 5f0afb8

Please sign in to comment.