Skip to content

Commit

Permalink
Move severity to class side also
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed May 28, 2024
1 parent 713dd1d commit fede3b8
Show file tree
Hide file tree
Showing 43 changed files with 229 additions and 219 deletions.
12 changes: 6 additions & 6 deletions src/General-Rules/ReAsClassRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ ReAsClassRule class >> ruleName [
^ 'Do not use #asClass & similar'
]

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

^ #error
]

{ #category : 'initialization' }
ReAsClassRule >> initialize [

Expand All @@ -33,9 +39,3 @@ ReAsClassRule >> initialize [
replace: '`@expr asClassIfAbsent: `@block' with: 'self class environment at: `@expr ifAbsent: `@block';
replace: '`@expr asClassIfPresent: `@block' with: 'self class environment at: `@expr ifPresent: `@block'
]

{ #category : 'accessing' }
ReAsClassRule >> severity [

^ #error
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReAssignmentWithoutEffectRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ ReAssignmentWithoutEffectRule class >> ruleName [
^ 'Assignment has no effect'
]

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -31,8 +36,3 @@ ReAssignmentWithoutEffectRule >> initialize [
super initialize.
self replace: '`var := `var' with: ''
]

{ #category : 'accessing' }
ReAssignmentWithoutEffectRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReBaselineProperlyPackagedRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ ReBaselineProperlyPackagedRule class >> ruleName [
^ 'Baseline class not properly packaged in a package with the same name'
]

{ #category : 'accessing' }
ReBaselineProperlyPackagedRule class >> severity [
^ #information
]

{ #category : 'manifest' }
ReBaselineProperlyPackagedRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -42,8 +47,3 @@ ReBaselineProperlyPackagedRule >> basicCheck: aClass [
^(aClass name beginsWith: 'BaselineOf')
and: [ aClass package name ~= aClass name ]
]

{ #category : 'accessing' }
ReBaselineProperlyPackagedRule >> severity [
^ #information
]
12 changes: 6 additions & 6 deletions src/General-Rules/ReBaselineWithProperSuperclassRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ReBaselineWithProperSuperclassRule class >> ruleName [
^ 'Custom Baseline class should be a subclass of predefined class BaselineOf'
]

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

^ #information
]

{ #category : 'manifest' }
ReBaselineWithProperSuperclassRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -43,9 +49,3 @@ ReBaselineWithProperSuperclassRule >> basicCheck: aClass [
and: [ (aClass inheritsFrom: BaselineOf) not ]

]

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

^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReBooleanPrecedenceRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ ReBooleanPrecedenceRule class >> ruleName [
^ 'Uses A | B = C instead of A | (B = C)'
]

{ #category : 'accessing' }
ReBooleanPrecedenceRule class >> severity [
^ #error
]

{ #category : 'accessing' }
ReBooleanPrecedenceRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -39,8 +44,3 @@ ReBooleanPrecedenceRule >> initialize [
'`@object1 & `@object2 ~= `@object3'
'`@object1 & `@object2 ~~ `@object3' )
]

{ #category : 'accessing' }
ReBooleanPrecedenceRule >> severity [
^ #error
]
12 changes: 6 additions & 6 deletions src/General-Rules/ReClassNotCategorizedRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ ReClassNotCategorizedRule class >> ruleName [
^ 'Uncategorized class - missing class tag'
]

{ #category : 'accessing' }
ReClassNotCategorizedRule class >> severity [

^ #information
]

{ #category : 'accessing' }
ReClassNotCategorizedRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -46,9 +52,3 @@ ReClassNotCategorizedRule >> basicCheck: aClass [

^ aClass packageTag isRoot and: [ aClass package tags size > 1 ]
]

{ #category : 'accessing' }
ReClassNotCategorizedRule >> severity [

^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReClassNotReferencedRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ ReClassNotReferencedRule class >> ruleName [
^ 'Class not referenced'
]

{ #category : 'accessing' }
ReClassNotReferencedRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReClassNotReferencedRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -40,8 +45,3 @@ ReClassNotReferencedRule class >> uniqueIdentifierName [
ReClassNotReferencedRule >> basicCheck: aClass [
^ aClass isUsed not
]

{ #category : 'accessing' }
ReClassNotReferencedRule >> severity [
^ #information
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ReClassVariableNeitherReadNorWrittenRule class >> ruleName [
^ 'Class variable not read or not written'
]

{ #category : 'accessing' }
ReClassVariableNeitherReadNorWrittenRule class >> severity [
^ #information
]

{ #category : 'running' }
ReClassVariableNeitherReadNorWrittenRule >> check: aClass forCritiquesDo: aCriticBlock [

Expand All @@ -36,11 +41,6 @@ ReClassVariableNeitherReadNorWrittenRule >> check: aClass forCritiquesDo: aCriti
thenDo: [ :variable | aCriticBlock cull: (self critiqueFor: aClass about: variable name) ]
]

{ #category : 'accessing' }
ReClassVariableNeitherReadNorWrittenRule >> severity [
^ #information
]

{ #category : 'running' }
ReClassVariableNeitherReadNorWrittenRule >> unreferencedVariablesOf: aClass [

Expand Down
10 changes: 5 additions & 5 deletions src/General-Rules/ReCodeCruftLeftInMethodsRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ ReCodeCruftLeftInMethodsRule class >> ruleName [
^ 'Debugging code left in methods'
]

{ #category : 'accessing' }
ReCodeCruftLeftInMethodsRule class >> severity [
^ #error
]

{ #category : 'accessing' }
ReCodeCruftLeftInMethodsRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand Down Expand Up @@ -116,8 +121,3 @@ ReCodeCruftLeftInMethodsRule >> patternForKeywordSelector: selector [
ReCodeCruftLeftInMethodsRule >> patterns [
^ self debuggingPatterns, self haltPatterns
]

{ #category : 'accessing' }
ReCodeCruftLeftInMethodsRule >> severity [
^ #error
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReDeadBlockRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ReDeadBlockRule class >> ruleName [
^ 'Dead Block'
]

{ #category : 'accessing' }
ReDeadBlockRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReDeadBlockRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -37,8 +42,3 @@ ReDeadBlockRule class >> uniqueIdentifierName [
ReDeadBlockRule >> basicCheck: node [
^ node isBlock and: [ node isUsedAsReturnValue not ]
]

{ #category : 'accessing' }
ReDeadBlockRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReEqualsTrueRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ ReEqualsTrueRule class >> ruleName [
^ 'Unnecessary "= true"'
]

{ #category : 'accessing' }
ReEqualsTrueRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReEqualsTrueRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -35,8 +40,3 @@ ReEqualsTrueRule >> basicCheck: aNode [
parent isMessage ifFalse: [ ^ false ].
^ #(#= #== #~= #~~) includes: parent selector
]

{ #category : 'accessing' }
ReEqualsTrueRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReExtraBlockRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ ReExtraBlockRule class >> ruleName [
^ 'Block immediately evaluated'
]

{ #category : 'accessing' }
ReExtraBlockRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReExtraBlockRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -42,8 +47,3 @@ ReExtraBlockRule >> blockEvaluatingMessages [
cull: cull:cull: cull:cull:cull: cull:cull:cull:cull:
#valueWithArguments: valueWithPossibleArgs: valueWithPossibleArgument)
]

{ #category : 'accessing' }
ReExtraBlockRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReImplementedNotSentRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ ReImplementedNotSentRule class >> ruleName [
^ 'Methods implemented but not sent'
]

{ #category : 'accessing' }
ReImplementedNotSentRule class >> severity [
^ #information
]

{ #category : 'cleanup' }
ReImplementedNotSentRule class >> shutDown [
self reset
Expand Down Expand Up @@ -146,8 +151,3 @@ ReImplementedNotSentRule >> basicCheck: aMethod [
false ] ]
ifFalse: [ false ] ]
]

{ #category : 'accessing' }
ReImplementedNotSentRule >> severity [
^ #information
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ReInconsistentMethodClassificationRule class >> ruleName [
^ 'Inconsistent method classification'
]

{ #category : 'accessing' }
ReInconsistentMethodClassificationRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReInconsistentMethodClassificationRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand Down Expand Up @@ -55,8 +60,3 @@ ReInconsistentMethodClassificationRule >> critiqueFor: aMethod [
^ (ReRefactoringCritique withAnchor: (self anchorFor: aMethod) by: self) refactoring:
(RBMethodProtocolTransformation protocol: { aMethod overriddenMethod protocolName } inMethod: aMethod selector inClass: aMethod methodClass name)
]

{ #category : 'accessing' }
ReInconsistentMethodClassificationRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReInstVarInSubclassesRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ ReInstVarInSubclassesRule class >> ruleName [
^ 'Same instance variable defined in ALL subclasses'
]

{ #category : 'accessing' }
ReInstVarInSubclassesRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReInstVarInSubclassesRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand Down Expand Up @@ -66,8 +71,3 @@ ReInstVarInSubclassesRule >> critiqueFor: aClass [
withAnchor: (self anchorFor: aClass)
by: self
]

{ #category : 'accessing' }
ReInstVarInSubclassesRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReIvarNeitherReadNorWrittenRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ReIvarNeitherReadNorWrittenRule class >> ruleName [
^ 'Instance variable not read or not written'
]

{ #category : 'accessing' }
ReIvarNeitherReadNorWrittenRule class >> severity [
^ #information
]

{ #category : 'running' }
ReIvarNeitherReadNorWrittenRule >> check: aClass forCritiquesDo: aCriticBlock [

Expand All @@ -35,8 +40,3 @@ ReIvarNeitherReadNorWrittenRule >> check: aClass forCritiquesDo: aCriticBlock [
slot definingClass pragmas anySatisfy: [ :pragma | pragma selector = #ignoreUnusedVariables: and: [ (pragma argumentAt: 1) includes: slot name ] ] ] ]
thenDo: [ :slot | aCriticBlock cull: (self critiqueFor: aClass about: slot name) ]
]

{ #category : 'accessing' }
ReIvarNeitherReadNorWrittenRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReJustSendsSuperRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ ReJustSendsSuperRule class >> ruleName [
^ 'Method just sends super message'
]

{ #category : 'accessing' }
ReJustSendsSuperRule class >> severity [
^ #information
]

{ #category : 'accessing' }
ReJustSendsSuperRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -55,8 +60,3 @@ ReJustSendsSuperRule >> initialize [
super initialize.
matcher := RBParseTreeSearcher justSendsSuper
]

{ #category : 'accessing' }
ReJustSendsSuperRule >> severity [
^ #information
]
10 changes: 5 additions & 5 deletions src/General-Rules/ReMethodHasSyntaxErrorRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ ReMethodHasSyntaxErrorRule class >> ruleName [
^ 'Method source has syntax errors'
]

{ #category : 'accessing' }
ReMethodHasSyntaxErrorRule class >> severity [
^ #error
]

{ #category : 'accessing' }
ReMethodHasSyntaxErrorRule class >> uniqueIdentifierName [
"This number should be unique and should change only when the rule completely change semantics"
Expand All @@ -35,8 +40,3 @@ ReMethodHasSyntaxErrorRule class >> uniqueIdentifierName [
ReMethodHasSyntaxErrorRule >> basicCheck: aMethod [
^aMethod isFaulty
]

{ #category : 'accessing' }
ReMethodHasSyntaxErrorRule >> severity [
^ #error
]
Loading

0 comments on commit fede3b8

Please sign in to comment.