Skip to content

Commit

Permalink
Move methods from Manifest
Browse files Browse the repository at this point in the history
Multiple methods are defined in the Manifest package but are used only for the critics UI. I propose to move them to the UI package.

I also used packages instead of categories and updated a call to a deprecated method.
  • Loading branch information
jecisc committed Oct 30, 2023
1 parent 57370db commit b18f3bb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 21 deletions.
8 changes: 8 additions & 0 deletions src/NewTools-CodeCritiques/ClassDescription.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : 'ClassDescription' }

{ #category : '*NewTools-CodeCritiques' }
ClassDescription >> criticNameOn: aStream [
"This behavior may be folded later by changing the name of this method or using another one."

aStream << self name << ' (' << self package name << ')'
]
14 changes: 14 additions & 0 deletions src/NewTools-CodeCritiques/CompiledMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : 'CompiledMethod' }

{ #category : '*NewTools-CodeCritiques' }
CompiledMethod >> criticNameOn: aStream [
"This behavior may be folded later by changing the name of this method or using another one."

aStream
<< self methodClass name
<< '>>#'
<< self selector
<< ' ('
<< self methodClass package name
<< ')'
]
8 changes: 8 additions & 0 deletions src/NewTools-CodeCritiques/RPackage.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : 'RPackage' }

{ #category : '*NewTools-CodeCritiques' }
RPackage >> criticNameOn: aStream [
"This behavior may be folded later by changing the name of this method or using another one."

aStream << self packageName
]
38 changes: 17 additions & 21 deletions src/NewTools-CodeCritiques/StCritiqueBrowserPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -143,32 +143,28 @@ StCritiqueBrowserPresenter >> allRules [

{ #category : 'private' }
StCritiqueBrowserPresenter >> applyRules [

| packageCount nbPackage process rules |
rules := self allRules.
nbPackage := rbEnvironment packages size.
packageCount := 0.
self updateTree.
process := [ rbEnvironment packages
do: [ :package |
| windowTitle |
packageCount := packageCount + 1.
windowTitle := String
streamContents: [ :s |
s << 'run rules on ' << package packageName << ' ('
<< packageCount asString << '/' << nbPackage asString << ')' ].
self setTitle: windowTitle.
checker
runRules: rules
onPackage: package
withoutTestCase: removeTestCase ].
checker rule: rules.
self setTitle: self defaultTitle.
cache packages: rbEnvironment.
cache initCache.
self rules: (self allRules select: [ :r | self hasBrokenRules: r]).
self rulesModel refresh.
self rebuildLayout.
self updateTree. ] newProcess.
process := [
rbEnvironment packages do: [ :package |
| windowTitle |
packageCount := packageCount + 1.
windowTitle := String streamContents: [ :s |
s << 'run rules on ' << package name << ' (' << packageCount asString << '/' << nbPackage asString << ')' ].
self setTitle: windowTitle.
checker runRules: rules onPackage: package withoutTestCase: removeTestCase ].
checker rule: rules.
self setTitle: self defaultTitle.
cache packages: rbEnvironment.
cache initCache.
self rules: (self allRules select: [ :r | self hasBrokenRules: r ]).
self rulesModel refresh.
self rebuildLayout.
self updateTree ] newProcess.
process name: 'SmallLint'.
process resume
]
Expand Down

0 comments on commit b18f3bb

Please sign in to comment.