Incorporating the Code Formatter in Envy QA into VA9
One of the things that I have noticed on larger (and smaller) Smalltalk development teams is that everyone has their own way of how they like code formatted. And since the envy repository treats it as a string, even adding a space will trigger the need to "save" a method. And over the life of a project, with developers coming and going, how the code looks/formats can go a great way in is its readability.
With the Envy QA apps now as part of the VA standard, I made a slight modification to some internal coding so that it doesn't matter how anyone saved their code in the repository. You can see it as you would like it formatted without having to resave it.
ifTrue: [residentClass classSuppliedSourceFor: self] "Ask the class for its source"
methodSourceAt: self filePointer
decompress: true]. "No class-supplied source, get it from the library"
(Smalltalk classAt: #CfFormatter) notNil
source := CfFormatter new
^EmImageSupport sourceFilter filter: source
I throw this out there for any one to use, or tell me that I've missed something, or that they know of a less "intrusive" way to do this.......
Any thoughts? I've found it to be incredibly helpful to set up my CfFormatter settings the way I like it, and then be able to peruse code in a format that makes it easier for me to read and understand.....