Skip to content

Commit

Permalink
Merge pull request #606 from jecisc/move-methods-in-right-package
Browse files Browse the repository at this point in the history
Move methods from Manifest
  • Loading branch information
MarcusDenker authored Oct 31, 2023
2 parents 57370db + b18f3bb commit 5a059ca
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 5a059ca

Please sign in to comment.