Skip to content

Commit

Permalink
Speed up setting browser
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed May 28, 2024
1 parent fede3b8 commit dc58d3d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
17 changes: 5 additions & 12 deletions src/General-Rules-Tests/ReSmalllintTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,11 @@ ReSmalllintTest >> assertEnvironment: anEnvironment hasAllMethodsOfTheResult: cr

{ #category : 'private' }
ReSmalllintTest >> assertIsValidRule: aRule [
self
assert: (aRule name isString and: [ aRule name notEmpty ])
description: 'Missing rule name'.
self
assert: (aRule group isString and: [ aRule group notEmpty ])
description: 'Missing group name'.
self
assert: (aRule rationale isString and: [ aRule rationale notEmpty ])
description: 'Missing rationale'.
self
assert: (#(error warning information) includes: aRule severity)
description: 'Invalid severity'

self assert: (aRule name isString and: [ aRule name isNotEmpty ]) description: 'Missing rule name'.
self assert: (aRule group isString and: [ aRule group isNotEmpty ]) description: 'Missing group name'.
self assert: (aRule rationale isString and: [ aRule rationale isNotEmpty ]) description: 'Missing rationale'.
self assert: (#( error warning information ) includes: aRule severity) description: 'Invalid severity'
]

{ #category : 'asserting' }
Expand Down
7 changes: 6 additions & 1 deletion src/General-Rules/ReLongMethodsRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ ReLongMethodsRule class >> group [
^ 'Design Flaws'
]

{ #category : 'private' }
ReLongMethodsRule class >> longMethodSize [
^ 20
]

{ #category : 'accessing' }
ReLongMethodsRule class >> rationale [
^ 'This smell arises when a long method is found (with {1} or more statements). Note that, it counts statements, not lines. Long methods should often be split into several smaller ones.
Expand Down Expand Up @@ -70,5 +75,5 @@ ReLongMethodsRule >> basicCheck: aMethod [

{ #category : 'private' }
ReLongMethodsRule >> longMethodSize [
^ 20
^ self class longMethodSize
]
16 changes: 7 additions & 9 deletions src/Renraku/ReRuleManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,21 @@ ReRuleManager class >> ruleToggleGroupID [

{ #category : 'settings' }
ReRuleManager class >> ruleToggleSettingsOn: aBuilder [

<systemsettings>
(aBuilder group: self ruleToggleGroupID)
order: 1;
label: 'Toggle rules to run';
description: 'Select which rules do you want to see in the live feedback';
parent: #qualityAssistant;
with: [
(self visibleRuleClasses sorted: [ :a :b | a name < b name ])
do: [ :rule |
| inst |
inst := rule new.
(self visibleRuleClasses sorted: [ :a :b | a name < b name ]) do: [ :rule |
(aBuilder setting: rule enabledSettingID)
selector: #enabled;
target: rule;
default: rule enabled;
label: inst name;
description: inst rationale ] ]
selector: #enabled;
target: rule;
default: rule enabled;
label: rule name;
description: rule rationale ] ]
]

{ #category : 'accessing' }
Expand Down

0 comments on commit dc58d3d

Please sign in to comment.