Skip to content

Commit

Permalink
Move group metadate of rules class side
Browse files Browse the repository at this point in the history
This change moves the method #group of rules from the instance side to the class side.
This is a metadata that will not change for any instance of the rule so it makes sense to have it class side. It will be useful for Angel to implement some features. Currently, if we want the group of a rule we need to create a new instance and this takes some times because of the initializations of the rules. This change will make it uch faster to know the group of a rule for which we do not have an instance.

There is a temporary hack to deprecate the instance side group method that could still be here for rule existing outside pharo to let them move the group on the class side without breaking the tools that will use the new class side method
  • Loading branch information
jecisc committed May 28, 2024
1 parent ee6a0d1 commit 05bc658
Show file tree
Hide file tree
Showing 163 changed files with 805 additions and 755 deletions.
10 changes: 5 additions & 5 deletions src/General-Rules/FloatReferencesRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Class {
#tag : 'Base'
}

{ #category : 'accessing' }
FloatReferencesRule class >> group [
^ 'Bugs'
]

{ #category : 'running' }
FloatReferencesRule >> basicCheck: node [
node isGlobalVariable ifFalse: [ ^ false ].
^(self systemClassNames includes: node name)
]

{ #category : 'accessing' }
FloatReferencesRule >> group [
^ 'Bugs'
]

{ #category : 'accessing' }
FloatReferencesRule >> name [

Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/OverridesDeprecatedMethodRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ OverridesDeprecatedMethodRule class >> checksMethod [
^ true
]

{ #category : 'accessing' }
OverridesDeprecatedMethodRule class >> group [
^ 'Potential Bugs'
]

{ #category : 'accessing' }
OverridesDeprecatedMethodRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -30,11 +35,6 @@ OverridesDeprecatedMethodRule >> basicCheck: aMethod [
^ aMethod overriddenMethods anySatisfy: #isDeprecated
]

{ #category : 'accessing' }
OverridesDeprecatedMethodRule >> group [
^ 'Potential Bugs'
]

{ #category : 'accessing' }
OverridesDeprecatedMethodRule >> name [
^ 'Overrides a deprecated method'
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAddRemoveDependentsRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ ReAddRemoveDependentsRule class >> checksClass [
^ true
]

{ #category : 'accessing' }
ReAddRemoveDependentsRule class >> group [
^ 'Potential Bugs'
]

{ #category : 'accessing' }
ReAddRemoveDependentsRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -35,11 +40,6 @@ ReAddRemoveDependentsRule >> basicCheck: aClass [
^ addSends > removeSends
]

{ #category : 'accessing' }
ReAddRemoveDependentsRule >> group [
^ 'Potential Bugs'
]

{ #category : 'accessing' }
ReAddRemoveDependentsRule >> name [
^ 'Number of addDependent: messages > removeDependent:'
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAllAnyNoneSatisfyRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAllAnyNoneSatisfyRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReAllAnyNoneSatisfyRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AllAnyNoneSatisfyRule'
]

{ #category : 'accessing' }
ReAllAnyNoneSatisfyRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'initialization' }
ReAllAnyNoneSatisfyRule >> initialize [
super initialize.
Expand Down
2 changes: 1 addition & 1 deletion src/General-Rules/ReAsClassRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Class {
}

{ #category : 'accessing' }
ReAsClassRule >> group [
ReAsClassRule class >> group [

^ 'Design Flaws'
]
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAsOrderedCollectionNotNeededRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAsOrderedCollectionNotNeededRule class >> group [
^ 'Optimization'
]

{ #category : 'accessing' }
ReAsOrderedCollectionNotNeededRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AsOrderedCollectionNotNeededRule'
]

{ #category : 'accessing' }
ReAsOrderedCollectionNotNeededRule >> group [
^ 'Optimization'
]

{ #category : 'initialization' }
ReAsOrderedCollectionNotNeededRule >> initialize [
super initialize.
Expand Down
2 changes: 1 addition & 1 deletion src/General-Rules/ReAssertWithBooleanEqualtiyRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
}

{ #category : 'accessing' }
ReAssertWithBooleanEqualtiyRule >> group [
ReAssertWithBooleanEqualtiyRule class >> group [

^ 'Optimization'
]
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAssignmentInBlockRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAssignmentInBlockRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReAssignmentInBlockRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AssignmentInBlockRule'
]

{ #category : 'accessing' }
ReAssignmentInBlockRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'initialization' }
ReAssignmentInBlockRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAssignmentInIfTrueRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAssignmentInIfTrueRule class >> group [
^ 'Optimization'
]

{ #category : 'accessing' }
ReAssignmentInIfTrueRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AssignmentInIfTrueRule'
]

{ #category : 'accessing' }
ReAssignmentInIfTrueRule >> group [
^ 'Optimization'
]

{ #category : 'initialization' }
ReAssignmentInIfTrueRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAssignmentWithoutEffectRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule class >> group [
^ 'Optimization'
]

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AssignmentWithoutEffectRule'
]

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule >> group [
^ 'Optimization'
]

{ #category : 'initialization' }
ReAssignmentWithoutEffectRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReAtIfAbsentRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReAtIfAbsentRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReAtIfAbsentRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'AtIfAbsentRule'
]

{ #category : 'accessing' }
ReAtIfAbsentRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'initialization' }
ReAtIfAbsentRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReBadMessageRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReBadMessageRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReBadMessageRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -31,11 +36,6 @@ ReBadMessageRule >> basicCheck: aNode [
^ self badSelectors includes: aNode selector
]

{ #category : 'accessing' }
ReBadMessageRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReBadMessageRule >> name [
^ 'Sends "questionable" message'
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReBaselineProperlyPackagedRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ ReBaselineProperlyPackagedRule class >> checksClass [
^ true
]

{ #category : 'accessing' }
ReBaselineProperlyPackagedRule class >> group [
^ 'Design Flaws'
]

{ #category : 'manifest' }
ReBaselineProperlyPackagedRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -33,11 +38,6 @@ ReBaselineProperlyPackagedRule >> basicCheck: aClass [
and: [ aClass package name ~= aClass name ]
]

{ #category : 'accessing' }
ReBaselineProperlyPackagedRule >> group [
^ 'Design Flaws'
]

{ #category : 'accessing' }
ReBaselineProperlyPackagedRule >> name [
^ 'Baseline class not properly packaged in a package with the same name'
Expand Down
12 changes: 6 additions & 6 deletions src/General-Rules/ReBaselineWithProperSuperclassRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ ReBaselineWithProperSuperclassRule class >> checksClass [
^ true
]

{ #category : 'accessing' }
ReBaselineWithProperSuperclassRule class >> group [

^ 'Design Flaws'
]

{ #category : 'manifest' }
ReBaselineWithProperSuperclassRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -33,12 +39,6 @@ ReBaselineWithProperSuperclassRule >> basicCheck: aClass [

]

{ #category : 'accessing' }
ReBaselineWithProperSuperclassRule >> group [

^ 'Design Flaws'
]

{ #category : 'accessing' }
ReBaselineWithProperSuperclassRule >> name [

Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReBetweenAndRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReBetweenAndRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReBetweenAndRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'BetweenAndRule'
]

{ #category : 'accessing' }
ReBetweenAndRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'initialization' }
ReBetweenAndRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReBooleanPrecedenceRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReBooleanPrecedenceRule class >> group [
^ 'Potential Bugs'
]

{ #category : 'accessing' }
ReBooleanPrecedenceRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'BooleanPrecedenceRule'
]

{ #category : 'accessing' }
ReBooleanPrecedenceRule >> group [
^ 'Potential Bugs'
]

{ #category : 'initialization' }
ReBooleanPrecedenceRule >> initialize [
super initialize.
Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReCascadedNextPutAllsRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ Class {
#tag : 'Migrated'
}

{ #category : 'accessing' }
ReCascadedNextPutAllsRule class >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'accessing' }
ReCascadedNextPutAllsRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"

^'CascadedNextPutAllsRule'
]

{ #category : 'accessing' }
ReCascadedNextPutAllsRule >> group [
^ 'Coding Idiom Violation'
]

{ #category : 'initialization' }
ReCascadedNextPutAllsRule >> initialize [
super initialize.
Expand Down
Loading

0 comments on commit 05bc658

Please sign in to comment.