getting real changes from RB refactoring
Hi, is there some filter that will reject RB changes that actually do not do anything? I.e. applying them would have no effect (same method code, class, inst var exists, ...). For methods I can do reject: [ :each | each oldVersionTextToDisplay = each textToDisplay ] for adding classes I had to add custom #oldVersionTextToDisplay ``` RBAddClassChange>>oldVersionTextToDisplay | class | class := Smalltalk globals at: self changeClassName ifAbsent: [ ^ '' ]. ^ '<1s> subclass: #<2s><n><t>instanceVariableNames: <3p><n><t>classVariableNames: <4p><n><t>poolDictionaries: ''''<n><t>category: ''<5s>''' expandMacrosWithArguments: {class superclass name. class name. class instanceVariables joinUsing: ' '. class classVariables joinUsing: ' '. class package name} ``` which is obviously ugly. Also RBAddClassChange doesn't understand any format where #package is used instead of #category, or slots are used. (As defined in RBAddClassChange class>>definitionPatterns , which is really weird). Peter
Hi peter
is there some filter that will reject RB changes that actually do not do anything? I.e. applying them would have no effect (same method code, class, inst var exists, ...).
I do not know. Do you have an example of when such changes are created?
For methods I can do
reject: [ :each | each oldVersionTextToDisplay = each textToDisplay ]
for adding classes I had to add custom #oldVersionTextToDisplay
``` RBAddClassChange>>oldVersionTextToDisplay | class | class := Smalltalk globals at: self changeClassName ifAbsent: [ ^ '' ]. ^ '<1s> subclass: #<2s><n><t>instanceVariableNames: <3p><n><t>classVariableNames: <4p><n><t>poolDictionaries: ''''<n><t>category: ''<5s>''' expandMacrosWithArguments: {class superclass name. class name. class instanceVariables joinUsing: ' '. class classVariables joinUsing: ' '. class package name} ```
which is obviously ugly.
Also RBAddClassChange doesn't understand any format where #package is used instead of #category, or slots are used.
(As defined in RBAddClassChange class>>definitionPatterns , which is really weird).
We should change this.
Peter
-- Using Opera's mail client: http://www.opera.com/mail/
On Sun, Feb 12, 2017 at 6:33 PM, stepharong <stepharong@free.fr> wrote:
Hi peter
is there some filter that will reject RB changes that actually do not do
anything? I.e. applying them would have no effect (same method code, class, inst var exists, ...).
I do not know. Do you have an example of when such changes are created?
Well, I generate the changes with this https://github.com/peteruhnak/xml-magritte-generator So when I want to regenerate the code, I want to see just the things that will be actually changed.
participants (3)
-
Peter Uhnak -
Peter Uhnák -
stepharong