Skip to content

Commit 480e365

Browse files
committed
Rename groovy SupportedVersionRangeRule to EC5002 for rule key homogeneisation
1 parent 14fda49 commit 480e365

File tree

13 files changed

+21
-21
lines changed

13 files changed

+21
-21
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ruleKey;remediationFunction;remediationFactor
22
EC5001;linear;1h
3-
org.codenarc.rule.ecocode.SupportedVersionRangeRule;linear;10min
3+
EC5002;linear;10min
44
org.codenarc.rule.ecocode.DisableObfuscationRule;linear;10min
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
EC5001
2-
org.codenarc.rule.ecocode.SupportedVersionRangeRule
2+
EC5002
33
org.codenarc.rule.ecocode.DisableObfuscationRule

android-plugin/src/main/resources/org/sonar/plugins/groovy/rules.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646

4747
<!-- since 2.2.1 -->
4848
<rule>
49-
<key>org.codenarc.rule.ecocode.SupportedVersionRangeRule</key>
49+
<key>EC5002</key>
5050
<severity>MINOR</severity>
5151
<name><![CDATA[Supported Version Range]]></name>
52-
<internalKey><![CDATA[SupportedVersionRange]]></internalKey>
52+
<internalKey><![CDATA[EC5002]]></internalKey>
5353
<description><![CDATA[<p>When looking at the minSdkVersion and targetSdkVersion (or minSdk, targetSdk) attributes for the <uses-sdk> in the AndroidManifest.xml file, the amplitude of supported platform versions should not be too wide, at the risk of making the app too heavy to handle all cases.</p>
5454
<p>Example of violations:</p>
5555
<pre><code>android {

codenarc-converter/CodeNarc/docs/StarterRuleSet-AllRules.groovy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ ruleset {
8989
DuplicateSetValue
9090
DuplicateStringLiteral
9191
EC5001
92+
EC5002
9293
ElseBlockBraces
9394
EmptyCatchBlock
9495
EmptyClass
@@ -304,7 +305,6 @@ ruleset {
304305
StaticMatcherField
305306
StaticMethodsBeforeInstanceMethods
306307
StaticSimpleDateFormatField
307-
SupportedVersionRange
308308
SwallowThreadDeath
309309
SynchronizedMethod
310310
SynchronizedOnBoxedPrimitive

codenarc-converter/CodeNarc/docs/StarterRuleSet-AllRulesByCategory.groovy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ ruleset {
167167

168168
// rulesets/ecocode.xml
169169
EC5001
170-
SupportedVersionRange
170+
EC5002
171171
DisableObfuscation
172172

173173
// rulesets/enhanced.xml

codenarc-converter/CodeNarc/docs/codenarc-rule-index-by-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ title: CodeNarc - Rule Index by Name
9191
* [DuplicateSetValue](./codenarc-rules-basic.html#duplicatesetvalue-rule)
9292
* [DuplicateStringLiteral](./codenarc-rules-dry.html#duplicatestringliteral-rule)
9393
* [EC5001](./codenarc-rules-ecocode.html#EC5001-rule)
94+
* [EC5002](./codenarc-rules-ecocode.html#EC5002-rule)
9495
* [ElseBlockBraces](./codenarc-rules-braces.html#elseblockbraces-rule)
9596
* [EmptyCatchBlock](./codenarc-rules-basic.html#emptycatchblock-rule)
9697
* [EmptyClass](./codenarc-rules-basic.html#emptyclass-rule)
@@ -306,7 +307,6 @@ title: CodeNarc - Rule Index by Name
306307
* [StaticMatcherField](./codenarc-rules-concurrency.html#staticmatcherfield-rule)
307308
* [StaticMethodsBeforeInstanceMethods](./codenarc-rules-convention.html#staticmethodsbeforeinstancemethods-rule)
308309
* [StaticSimpleDateFormatField](./codenarc-rules-concurrency.html#staticsimpledateformatfield-rule)
309-
* [SupportedVersionRange](./codenarc-rules-ecocode.html#supportedversionrange-rule)
310310
* [SwallowThreadDeath](./codenarc-rules-exceptions.html#swallowthreaddeath-rule)
311311
* [SynchronizedMethod](./codenarc-rules-concurrency.html#synchronizedmethod-rule)
312312
* [SynchronizedOnBoxedPrimitive](./codenarc-rules-concurrency.html#synchronizedonboxedprimitive-rule)

codenarc-converter/CodeNarc/docs/codenarc-rule-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ title: CodeNarc - Rule Index
168168

169169
## [Ecocode](./codenarc-rules-ecocode.html)
170170
* [EC5001](./codenarc-rules-ecocode.html#EC5001-rule)
171-
* [SupportedVersionRange](./codenarc-rules-ecocode.html#supportedversionrange-rule)
171+
* [EC5002](./codenarc-rules-ecocode.html#EC5002-rule)
172172
* [DisableObfuscation](./codenarc-rules-ecocode.html#disableobfuscation-rule)
173173

174174
## [Enhanced](./codenarc-rules-enhanced.html)

codenarc-converter/CodeNarc/docs/codenarc-rules-ecocode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Example of violations:
4545
}
4646
```
4747

48-
## SupportedVersionRange Rule
48+
## EC5002 Rule
4949

5050
*Since CodeNarc 2.2.1*
5151

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ import org.codenarc.util.AstUtil
2626
*
2727
* @author Leboulanger Mickael
2828
*/
29-
class SupportedVersionRangeRule extends AbstractAstVisitorRule {
29+
class EC5002 extends AbstractAstVisitorRule {
3030

31-
String name = 'SupportedVersionRange'
31+
String name = 'EC5002'
3232
int priority = 2
3333
int minSdkVersion = 0
3434
int minSdk = 0
3535
int targetSdkVersion = 0
3636
int targetSdk = 0
3737
int threshold = 4 // Value used to compare minSdkVersion and targetSdkVersion
38-
Class astVisitorClass = SupportedVersionRangeAstVisitor
38+
Class astVisitorClass = EC5002AstVisitor
3939
}
4040

41-
class SupportedVersionRangeAstVisitor extends AbstractAstVisitor {
41+
class EC5002AstVisitor extends AbstractAstVisitor {
4242

4343
@Override
4444
void visitMethodCallExpression(MethodCallExpression methodCallExpression) {

codenarc-converter/CodeNarc/src/main/resources/codenarc-base-messages.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
DisableObfuscation.description=Using minifyEnabled true will obfuscate code and will have a sligthly negative impact on power consumption at runtime.
33
DisableObfuscation.description.html=Using minifyEnabled true will obfuscate code and will have a sligthly negative impact on power consumption at runtime.
44

5-
SupportedVersionRange.description=The amplitude of supported platform versions should not be too wide, at the risk of making the app too heavy to handle all cases.
6-
SupportedVersionRange.description.html=The amplitude of supported platform versions should not be too wide, at the risk of making the app too heavy to handle all cases.
5+
EC5002.description=The amplitude of supported platform versions should not be too wide, at the risk of making the app too heavy to handle all cases.
6+
EC5002.description.html=The amplitude of supported platform versions should not be too wide, at the risk of making the app too heavy to handle all cases.
77

88
EC5001.description=Using "multiDexEnabled true" goes against the overall reduction of the weight of the apps and hence must be avoided.
99
EC5001.description.html=Using "multiDexEnabled true" goes against the overall reduction of the weight of the apps and hence must be avoided.

0 commit comments

Comments
 (0)