From 0197c5a25aec6f1398ab03726a26b5eacf04568c Mon Sep 17 00:00:00 2001 From: myroslavarm Date: Fri, 24 Apr 2020 17:41:09 +0200 Subject: [PATCH] fixes #5494 --- src/ReleaseTests/ReleaseTest.class.st | 2 +- .../ReTestClassNameShouldEndWithTestTest.class.st | 6 +++--- ...lassNotInPackageWithTestEndingNameTest.class.st | 4 ++-- ...spectorPresentationsNonBlockSetupRule.class.st} | 12 ++++++------ ...InspectorPresentationsNonlazyCodeRule.class.st} | 12 ++++++------ ...festShouldBePackagedInManifestTagRule.class.st} | 14 +++++++------- ...erMethodProtocolNameForConvertingRule.class.st} | 4 ++-- ...odProtocolNameForInstanceCreationRule.class.st} | 4 ++-- ...perMethodProtocolNameForUtilitiesRule.class.st} | 4 ++-- ... ReTestClassNameShouldEndWithTestRule.class.st} | 14 +++++++------- ...assNotInPackageWithTestEndingNameRule.class.st} | 14 +++++++------- ...eAccess.class.st => ReThemeAccessRule.class.st} | 14 +++++++------- 12 files changed, 52 insertions(+), 52 deletions(-) rename src/Renraku/{ReInspectorPresentationsNonBlockSetup.class.st => ReInspectorPresentationsNonBlockSetupRule.class.st} (74%) rename src/Renraku/{ReInspectorPresentationsNonlazyCode.class.st => ReInspectorPresentationsNonlazyCodeRule.class.st} (74%) rename src/Renraku/{RePackageManifestShouldBePackagedInManifestTag.class.st => RePackageManifestShouldBePackagedInManifestTagRule.class.st} (58%) rename src/Renraku/{ReProperMethodProtocolNameRuleForConverting.class.st => ReProperMethodProtocolNameForConvertingRule.class.st} (69%) rename src/Renraku/{ReProperMethodProtocolNameRuleForInstanceCreation.class.st => ReProperMethodProtocolNameForInstanceCreationRule.class.st} (73%) rename src/Renraku/{ReProperMethodProtocolNameRuleForUtilities.class.st => ReProperMethodProtocolNameForUtilitiesRule.class.st} (69%) rename src/Renraku/{ReTestClassNameShouldEndWithTest.class.st => ReTestClassNameShouldEndWithTestRule.class.st} (64%) rename src/Renraku/{ReTestClassNotInPackageWithTestEndingName.class.st => ReTestClassNotInPackageWithTestEndingNameRule.class.st} (59%) rename src/Renraku/{ReThemeAccess.class.st => ReThemeAccessRule.class.st} (77%) diff --git a/src/ReleaseTests/ReleaseTest.class.st b/src/ReleaseTests/ReleaseTest.class.st index 556637964a8..85507fa0bb3 100644 --- a/src/ReleaseTests/ReleaseTest.class.st +++ b/src/ReleaseTests/ReleaseTest.class.st @@ -297,7 +297,7 @@ ReleaseTest >> testShouldWorldMorphBeAfterFontClassesInStartupList [ { #category : #tests } ReleaseTest >> testTestCasesEndsWithTestOrTestCase [ - self assertValidLintRule: ReTestClassNameShouldEndWithTest new + self assertValidLintRule: ReTestClassNameShouldEndWithTestRule new ] diff --git a/src/Renraku-Tests/ReTestClassNameShouldEndWithTestTest.class.st b/src/Renraku-Tests/ReTestClassNameShouldEndWithTestTest.class.st index 5110ec6a87c..d3c3ee2d00d 100644 --- a/src/Renraku-Tests/ReTestClassNameShouldEndWithTestTest.class.st +++ b/src/Renraku-Tests/ReTestClassNameShouldEndWithTestTest.class.st @@ -6,14 +6,14 @@ Class { { #category : #tests } ReTestClassNameShouldEndWithTestTest >> testBasicCheck [ - self assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTest ]). + self assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTestRule ]). testClass rename: 'TotoTestCase'. - self assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTest ]). + self assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTestRule ]). "test class name not endind with 'Test'" testClass rename: 'Toto'. - self assert: (testClass critiques anySatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTest ]) + self assert: (testClass critiques anySatisfy: [ :critic | critic rule class = ReTestClassNameShouldEndWithTestRule ]) ] diff --git a/src/Renraku-Tests/ReTestClassNotInPackageWithTestEndingNameTest.class.st b/src/Renraku-Tests/ReTestClassNotInPackageWithTestEndingNameTest.class.st index 3d574fd1a72..df51174c13d 100644 --- a/src/Renraku-Tests/ReTestClassNotInPackageWithTestEndingNameTest.class.st +++ b/src/Renraku-Tests/ReTestClassNotInPackageWithTestEndingNameTest.class.st @@ -9,11 +9,11 @@ ReTestClassNotInPackageWithTestEndingNameTest >> testBasicCheck [ "test in wrong package raises critic" self - assert: (testClass critiques anySatisfy: [ :critic | critic rule class = ReTestClassNotInPackageWithTestEndingName ]). + assert: (testClass critiques anySatisfy: [ :critic | critic rule class = ReTestClassNotInPackageWithTestEndingNameRule ]). "move to correct package" validTestPackage importClass: testClass. self - assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNotInPackageWithTestEndingName ]) + assert: (testClass critiques noneSatisfy: [ :critic | critic rule class = ReTestClassNotInPackageWithTestEndingNameRule ]) ] diff --git a/src/Renraku/ReInspectorPresentationsNonBlockSetup.class.st b/src/Renraku/ReInspectorPresentationsNonBlockSetupRule.class.st similarity index 74% rename from src/Renraku/ReInspectorPresentationsNonBlockSetup.class.st rename to src/Renraku/ReInspectorPresentationsNonBlockSetupRule.class.st index 31c61e342b3..daefa907b96 100644 --- a/src/Renraku/ReInspectorPresentationsNonBlockSetup.class.st +++ b/src/Renraku/ReInspectorPresentationsNonBlockSetupRule.class.st @@ -4,18 +4,18 @@ When setting up a glamorous presentation it is recommended to pass blocks (or li This affects the performance of inspector. " Class { - #name : #ReInspectorPresentationsNonBlockSetup, + #name : #ReInspectorPresentationsNonBlockSetupRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing-interest' } -ReInspectorPresentationsNonBlockSetup class >> checksMethod [ +ReInspectorPresentationsNonBlockSetupRule class >> checksMethod [ ^ true ] { #category : #running } -ReInspectorPresentationsNonBlockSetup >> check: aMethod forCritiquesDo: aCriticBlock [ +ReInspectorPresentationsNonBlockSetupRule >> check: aMethod forCritiquesDo: aCriticBlock [ (aMethod hasPragmaNamed: #gtInspectorPresentationOrder:) ifFalse: [ ^ self ]. @@ -36,18 +36,18 @@ ReInspectorPresentationsNonBlockSetup >> check: aMethod forCritiquesDo: aCriticB ] { #category : #accessing } -ReInspectorPresentationsNonBlockSetup >> group [ +ReInspectorPresentationsNonBlockSetupRule >> group [ ^ 'Optimization' ] { #category : #accessing } -ReInspectorPresentationsNonBlockSetup >> name [ +ReInspectorPresentationsNonBlockSetupRule >> name [ ^ 'Use blocks in scripting instead of plain messages' ] { #category : #private } -ReInspectorPresentationsNonBlockSetup >> presentationScriptingMathods [ +ReInspectorPresentationsNonBlockSetupRule >> presentationScriptingMathods [ ^ #(when: title: display: icon: with: send: format: sorted: tags:) ] diff --git a/src/Renraku/ReInspectorPresentationsNonlazyCode.class.st b/src/Renraku/ReInspectorPresentationsNonlazyCodeRule.class.st similarity index 74% rename from src/Renraku/ReInspectorPresentationsNonlazyCode.class.st rename to src/Renraku/ReInspectorPresentationsNonlazyCodeRule.class.st index e4dd2b41b86..32c68a6ba75 100644 --- a/src/Renraku/ReInspectorPresentationsNonlazyCode.class.st +++ b/src/Renraku/ReInspectorPresentationsNonlazyCodeRule.class.st @@ -4,18 +4,18 @@ If you execute some code during the method execution it will slow down the insp Try to put all the code in blocks in the setup messages, such as #title:, #display:, #when:. Buy doing this your code will be executed lazily when the presentation is selected. " Class { - #name : #ReInspectorPresentationsNonlazyCode, + #name : #ReInspectorPresentationsNonlazyCodeRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing-interest' } -ReInspectorPresentationsNonlazyCode class >> checksMethod [ +ReInspectorPresentationsNonlazyCodeRule class >> checksMethod [ ^ true ] { #category : #running } -ReInspectorPresentationsNonlazyCode >> check: aMethod forCritiquesDo: aCriticBlock [ +ReInspectorPresentationsNonlazyCodeRule >> check: aMethod forCritiquesDo: aCriticBlock [ (aMethod hasPragmaNamed: #gtInspectorPresentationOrder:) ifFalse: [ ^ self ]. @@ -35,18 +35,18 @@ ReInspectorPresentationsNonlazyCode >> check: aMethod forCritiquesDo: aCriticBlo ] { #category : #accessing } -ReInspectorPresentationsNonlazyCode >> group [ +ReInspectorPresentationsNonlazyCodeRule >> group [ ^ 'Optimization' ] { #category : #accessing } -ReInspectorPresentationsNonlazyCode >> name [ +ReInspectorPresentationsNonlazyCodeRule >> name [ ^ 'Code executed outside of the presentation setup' ] { #category : #private } -ReInspectorPresentationsNonlazyCode >> presentation: aPresentation isTheLeftmostRecepientIn: aStatement [ +ReInspectorPresentationsNonlazyCodeRule >> presentation: aPresentation isTheLeftmostRecepientIn: aStatement [ ^ (aStatement isMessage or: [ aStatement isCascade ]) and: [ diff --git a/src/Renraku/RePackageManifestShouldBePackagedInManifestTag.class.st b/src/Renraku/RePackageManifestShouldBePackagedInManifestTagRule.class.st similarity index 58% rename from src/Renraku/RePackageManifestShouldBePackagedInManifestTag.class.st rename to src/Renraku/RePackageManifestShouldBePackagedInManifestTagRule.class.st index c93c6ba4880..f8503fd9819 100644 --- a/src/Renraku/RePackageManifestShouldBePackagedInManifestTag.class.st +++ b/src/Renraku/RePackageManifestShouldBePackagedInManifestTagRule.class.st @@ -1,40 +1,40 @@ Class { - #name : #RePackageManifestShouldBePackagedInManifestTag, + #name : #RePackageManifestShouldBePackagedInManifestTagRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing - interest' } -RePackageManifestShouldBePackagedInManifestTag class >> checksClass [ +RePackageManifestShouldBePackagedInManifestTagRule class >> checksClass [ ^ true ] { #category : #running } -RePackageManifestShouldBePackagedInManifestTag >> basicCheck: aClass [ +RePackageManifestShouldBePackagedInManifestTagRule >> basicCheck: aClass [ ^ (aClass inheritsFrom: PackageManifest) and: [ ((aClass package classesForClassTag: 'Manifest') includes: aClass) not ] ] { #category : #accessing } -RePackageManifestShouldBePackagedInManifestTag >> group [ +RePackageManifestShouldBePackagedInManifestTagRule >> group [ ^ 'Coding Idiom Violation' ] { #category : #accessing } -RePackageManifestShouldBePackagedInManifestTag >> name [ +RePackageManifestShouldBePackagedInManifestTagRule >> name [ ^ 'A package manifest should be tagged using ''Manifest'' class tag' ] { #category : #accessing } -RePackageManifestShouldBePackagedInManifestTag >> rationale [ +RePackageManifestShouldBePackagedInManifestTagRule >> rationale [ ^ 'Check if the package manifest is tagged in class category ''Manifest'' to align with other packages and fulfil common expectations.' ] { #category : #accessing } -RePackageManifestShouldBePackagedInManifestTag >> severity [ +RePackageManifestShouldBePackagedInManifestTagRule >> severity [ ^ #warning ] diff --git a/src/Renraku/ReProperMethodProtocolNameRuleForConverting.class.st b/src/Renraku/ReProperMethodProtocolNameForConvertingRule.class.st similarity index 69% rename from src/Renraku/ReProperMethodProtocolNameRuleForConverting.class.st rename to src/Renraku/ReProperMethodProtocolNameForConvertingRule.class.st index 06d67efd3e5..e64e56de682 100644 --- a/src/Renraku/ReProperMethodProtocolNameRuleForConverting.class.st +++ b/src/Renraku/ReProperMethodProtocolNameForConvertingRule.class.st @@ -2,13 +2,13 @@ Rule to favour 'converting' method protocol over similar ones (like 'conversion' or other) " Class { - #name : #ReProperMethodProtocolNameRuleForConverting, + #name : #ReProperMethodProtocolNameForConvertingRule, #superclass : #ReProperMethodProtocolNameRule, #category : #'Renraku-Rules' } { #category : #idioms } -ReProperMethodProtocolNameRuleForConverting >> protocolIdiom [ +ReProperMethodProtocolNameForConvertingRule >> protocolIdiom [ ^self use: 'converting' insteadOf: #('conversion' 'conversions') ] diff --git a/src/Renraku/ReProperMethodProtocolNameRuleForInstanceCreation.class.st b/src/Renraku/ReProperMethodProtocolNameForInstanceCreationRule.class.st similarity index 73% rename from src/Renraku/ReProperMethodProtocolNameRuleForInstanceCreation.class.st rename to src/Renraku/ReProperMethodProtocolNameForInstanceCreationRule.class.st index 39ff4d61416..212fe56286f 100644 --- a/src/Renraku/ReProperMethodProtocolNameRuleForInstanceCreation.class.st +++ b/src/Renraku/ReProperMethodProtocolNameForInstanceCreationRule.class.st @@ -2,13 +2,13 @@ Rule to favour 'instance creation' method protocol over similar ones (like 'instance-creation' or other) " Class { - #name : #ReProperMethodProtocolNameRuleForInstanceCreation, + #name : #ReProperMethodProtocolNameForInstanceCreationRule, #superclass : #ReProperMethodProtocolNameRule, #category : #'Renraku-Rules' } { #category : #idioms } -ReProperMethodProtocolNameRuleForInstanceCreation >> protocolIdiom [ +ReProperMethodProtocolNameForInstanceCreationRule >> protocolIdiom [ ^self use: 'instance creation' insteadOf: #('instance-creation' 'instances-creation' 'instances creation') ] diff --git a/src/Renraku/ReProperMethodProtocolNameRuleForUtilities.class.st b/src/Renraku/ReProperMethodProtocolNameForUtilitiesRule.class.st similarity index 69% rename from src/Renraku/ReProperMethodProtocolNameRuleForUtilities.class.st rename to src/Renraku/ReProperMethodProtocolNameForUtilitiesRule.class.st index 41388df4a92..66885e4a754 100644 --- a/src/Renraku/ReProperMethodProtocolNameRuleForUtilities.class.st +++ b/src/Renraku/ReProperMethodProtocolNameForUtilitiesRule.class.st @@ -2,13 +2,13 @@ Rule to favour 'utilities' method protocol over similar ones (like 'utils' or other) " Class { - #name : #ReProperMethodProtocolNameRuleForUtilities, + #name : #ReProperMethodProtocolNameForUtilitiesRule, #superclass : #ReProperMethodProtocolNameRule, #category : #'Renraku-Rules' } { #category : #idioms } -ReProperMethodProtocolNameRuleForUtilities >> protocolIdiom [ +ReProperMethodProtocolNameForUtilitiesRule >> protocolIdiom [ ^self use: 'utilities' insteadOf: #('utils' 'utility') ] diff --git a/src/Renraku/ReTestClassNameShouldEndWithTest.class.st b/src/Renraku/ReTestClassNameShouldEndWithTestRule.class.st similarity index 64% rename from src/Renraku/ReTestClassNameShouldEndWithTest.class.st rename to src/Renraku/ReTestClassNameShouldEndWithTestRule.class.st index 5516d25992e..4af6a7f2655 100644 --- a/src/Renraku/ReTestClassNameShouldEndWithTest.class.st +++ b/src/Renraku/ReTestClassNameShouldEndWithTestRule.class.st @@ -2,40 +2,40 @@ Check if a subclass of TestCase ends with 'Test' or 'TestCase'. " Class { - #name : #ReTestClassNameShouldEndWithTest, + #name : #ReTestClassNameShouldEndWithTestRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing-interest' } -ReTestClassNameShouldEndWithTest class >> checksClass [ +ReTestClassNameShouldEndWithTestRule class >> checksClass [ ^ true ] { #category : #running } -ReTestClassNameShouldEndWithTest >> basicCheck: aClass [ +ReTestClassNameShouldEndWithTestRule >> basicCheck: aClass [ | suffixes | suffixes := #('Test' 'TestCase'). ^ (aClass inheritsFrom: TestCase) and: [ suffixes noneSatisfy: [ :suffix | aClass name asString endsWith: suffix ] ] ] { #category : #running } -ReTestClassNameShouldEndWithTest >> group [ +ReTestClassNameShouldEndWithTestRule >> group [ ^ 'Optimization' ] { #category : #accessing } -ReTestClassNameShouldEndWithTest >> name [ +ReTestClassNameShouldEndWithTestRule >> name [ ^ 'A Test class'' name should end with ''Test'' ' ] { #category : #accessing } -ReTestClassNameShouldEndWithTest >> rationale [ +ReTestClassNameShouldEndWithTestRule >> rationale [ ^ 'A test class (subclass of TestCase) should have it''s name ending with ''Test'' or ''TestCase''' ] { #category : #running } -ReTestClassNameShouldEndWithTest >> severity [ +ReTestClassNameShouldEndWithTestRule >> severity [ ^ #warning ] diff --git a/src/Renraku/ReTestClassNotInPackageWithTestEndingName.class.st b/src/Renraku/ReTestClassNotInPackageWithTestEndingNameRule.class.st similarity index 59% rename from src/Renraku/ReTestClassNotInPackageWithTestEndingName.class.st rename to src/Renraku/ReTestClassNotInPackageWithTestEndingNameRule.class.st index e187c3644a6..97c2e220d76 100644 --- a/src/Renraku/ReTestClassNotInPackageWithTestEndingName.class.st +++ b/src/Renraku/ReTestClassNotInPackageWithTestEndingNameRule.class.st @@ -2,39 +2,39 @@ A subclass of TestCase should be in package which name is ending with '-Tests' " Class { - #name : #ReTestClassNotInPackageWithTestEndingName, + #name : #ReTestClassNotInPackageWithTestEndingNameRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing-interest' } -ReTestClassNotInPackageWithTestEndingName class >> checksClass [ +ReTestClassNotInPackageWithTestEndingNameRule class >> checksClass [ ^ true ] { #category : #running } -ReTestClassNotInPackageWithTestEndingName >> basicCheck: aClass [ +ReTestClassNotInPackageWithTestEndingNameRule >> basicCheck: aClass [ ^ (aClass inheritsFrom: TestCase) and: [(aClass package name asString endsWith: '-Tests') not]. ] { #category : #running } -ReTestClassNotInPackageWithTestEndingName >> group [ +ReTestClassNotInPackageWithTestEndingNameRule >> group [ ^ 'Optimization' ] { #category : #accessing } -ReTestClassNotInPackageWithTestEndingName >> name [ +ReTestClassNotInPackageWithTestEndingNameRule >> name [ ^ 'Test class not in a package with name ending with ''-Tests'' ' ] { #category : #accessing } -ReTestClassNotInPackageWithTestEndingName >> rationale [ +ReTestClassNotInPackageWithTestEndingNameRule >> rationale [ ^ 'A test class (subclass of TestCase) should be placed in a package with a ''-Tests'' suffix' ] { #category : #running } -ReTestClassNotInPackageWithTestEndingName >> severity [ +ReTestClassNotInPackageWithTestEndingNameRule >> severity [ ^ #warning ] diff --git a/src/Renraku/ReThemeAccess.class.st b/src/Renraku/ReThemeAccessRule.class.st similarity index 77% rename from src/Renraku/ReThemeAccess.class.st rename to src/Renraku/ReThemeAccessRule.class.st index 77659dc934e..f76ff22a4fd 100644 --- a/src/Renraku/ReThemeAccess.class.st +++ b/src/Renraku/ReThemeAccessRule.class.st @@ -2,23 +2,23 @@ Morph and Model subclasses methods should access GUI theme via 'self theme' and not 'Smalltalk ui theme'. " Class { - #name : #ReThemeAccess, + #name : #ReThemeAccessRule, #superclass : #ReAbstractRule, #category : #'Renraku-Rules' } { #category : #'testing-interest' } -ReThemeAccess class >> checksMethod [ +ReThemeAccessRule class >> checksMethod [ ^ true ] { #category : #'class initialization' } -ReThemeAccess class >> initialize [ +ReThemeAccessRule class >> initialize [ " ReRuleManager cleanUp " ] { #category : #running } -ReThemeAccess >> check: aMethod forCritiquesDo: aCriticBlock [ +ReThemeAccessRule >> check: aMethod forCritiquesDo: aCriticBlock [ | problemThemes | ((aMethod methodClass inheritsFrom: Morph) or: [aMethod methodClass inheritsFrom: Model]) ifFalse: [ ^ self ]. @@ -35,16 +35,16 @@ ReThemeAccess >> check: aMethod forCritiquesDo: aCriticBlock [ ] { #category : #running } -ReThemeAccess >> group [ +ReThemeAccessRule >> group [ ^ 'API Hints' ] { #category : #running } -ReThemeAccess >> name [ +ReThemeAccessRule >> name [ ^ 'Access to UI theme.' ] { #category : #running } -ReThemeAccess >> severity [ +ReThemeAccessRule >> severity [ ^ #warning ]