Fix for Negated condition violators (retry)#18738
Fix for Negated condition violators (retry)#18738carolahp wants to merge 17 commits intopharo-project:Pharo14from
Conversation
|
This issue has either a default title or empty body. We would appreciate it if you could provide more information. Note: I am not a very intelligent bot, I can only react to new comments. Please add a comment for me if you update the body or title. |
balsa-sarenac
left a comment
There was a problem hiding this comment.
Just general comments not related to the PR, let me know when it's ready for full review.
| RBNewAbstractCondition >> candidates [ | ||
| "Complex conditions require this method to compute their own subjects" | ||
| ^ subjects |
There was a problem hiding this comment.
Should we rename iv to candidates too?
There was a problem hiding this comment.
Or, should this be removed since accessor is used everywhere?
There was a problem hiding this comment.
Yes! I am removing it since we are using the accessor everywhere
There was a problem hiding this comment.
This is general comment on all preconditions, we can discuss this on Thursday: I think we should have all Conditions classes be positive. I mean:
ReMethodsDontReferToLocalSharedVarsCondition -> ReMethodsReferToLocalSharedVarsCondition
This is easier to use, and negation makes more sense. Double negation is always a bit confusing and harder to reason about.
balsa-sarenac
left a comment
There was a problem hiding this comment.
What is the status of this PR? Should I do a full review?
Co-authored-by: Балша Шаренац <34557616+balsa-sarenac@users.noreply.github.com>
I am about to finish, I only have 13 tests not passing. |
…s-in-negated-conditions2
…olahp/pharo into fix/violators-in-negated-conditions2
|
There is a failing test |
|
We should merge P14 in this branch because I fixed those tests 2 days ago I think |
| self doesClassToBeRenamedExist and: [ self isNotMetaclass ] ]). | ||
| self isValidClassName. | ||
| self isNotGlobal } | ||
| ((ReClassesExistCondition new classes: { (class name -> class) }) & (ReClassesAreNotMetaClassCondition new classes: { class })). |
There was a problem hiding this comment.
These don't have to be joined with &, the have almost the same meaning if you put them as list items.
| ((ReClassesExistCondition new classes: { (class name -> class) }) & (ReClassesAreNotMetaClassCondition new classes: { class })). | |
| ((ReClassesExistCondition new classes: { (class name -> class) }). | |
| (ReClassesAreNotMetaClassCondition new classes: { class })). |
| ReReifiedCondition >> violationMessageOn: aStream violators: theViolators [ | ||
| | isNegated | | ||
| theViolators ifEmpty:[^self]. | ||
| isNegated := self violators ~= theViolators. | ||
|
|
||
| theViolators do: [ :violator | | ||
| aStream | ||
| nextPutAll: violator name; | ||
| nextPutAll: ('<1? is not:is>' expandMacrosWith: isNegated); | ||
| nextPutAll: ' empty.'; | ||
| space ] |
There was a problem hiding this comment.
This is in ReifiedCondition, could it be that it ended up here by mistake? Since this is mentioning something empty?
| ReNotInCascadedMessageCondition >> violationMessageOn: aStream violators: theViolators [ | ||
|
|
||
| theViolators = self violators | ||
| ifTrue: [ aStream nextPutAll: 'Cannot extract code in a cascaded message.' ] | ||
| ifFalse: [ aStream nextPutAll: 'Can extract code in a non cascaded message.' ] | ||
| ] |
There was a problem hiding this comment.
This is something to think about.
@Ducasse this condition is generic (is this message cascaded), and we use it in extract method, and this error message says you cannot extract method from cascade.
I think this should be general message here, and then Extract Method needs to make it specific for its use case?
| { #category : 'displaying' } | ||
| ReNameIsGlobalCondition >> violationMessageOn: aStream [ | ||
|
|
||
| self deprecated: 'Use violationMessageOn:violators: instead'. |
There was a problem hiding this comment.
Was this left here by mistake? or is this always deprecated? I forgot what we decided in the end
There was a problem hiding this comment.
@Ducasse these tests fail since ProtectVariableTransformation was removed. I'm guessing we should remove these tests as well? But also to make sure these tests exist for RBProtectInstanceVariableRefactoring
…olahp/pharo into fix/violators-in-negated-conditions2
No description provided.