diff --git a/src/NewTools-CodeCritiques/ClassDescription.extension.st b/src/NewTools-CodeCritiques/ClassDescription.extension.st new file mode 100644 index 000000000..a54b20207 --- /dev/null +++ b/src/NewTools-CodeCritiques/ClassDescription.extension.st @@ -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 << ')' +] diff --git a/src/NewTools-CodeCritiques/CompiledMethod.extension.st b/src/NewTools-CodeCritiques/CompiledMethod.extension.st new file mode 100644 index 000000000..59b365696 --- /dev/null +++ b/src/NewTools-CodeCritiques/CompiledMethod.extension.st @@ -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 + << ')' +] diff --git a/src/NewTools-CodeCritiques/RPackage.extension.st b/src/NewTools-CodeCritiques/RPackage.extension.st new file mode 100644 index 000000000..cba13aac4 --- /dev/null +++ b/src/NewTools-CodeCritiques/RPackage.extension.st @@ -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 +] diff --git a/src/NewTools-CodeCritiques/StCritiqueBrowserPresenter.class.st b/src/NewTools-CodeCritiques/StCritiqueBrowserPresenter.class.st index 4d61da85f..4018bd5e5 100644 --- a/src/NewTools-CodeCritiques/StCritiqueBrowserPresenter.class.st +++ b/src/NewTools-CodeCritiques/StCritiqueBrowserPresenter.class.st @@ -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 ]