Re: a simple formatter

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 21 Feb 2008 22:39:24 -0700

On Thu, 2008-02-21 at 20:01 +0200, Tsantilas Christos wrote:

> I believe, I solved (most of?) the problems in astyle.
> I am attaching the new version of the formatter.pl
> I test it only using the astyle version 1.21.

Christos,

    Thanks a lot for polishing this!

    Any objections to committing Christos' astyle wrapper and then
applying it to HEAD and selected branches? If there are no objections,
let's set a date for this. How about March, after 3.0.2 is released,
with a final 7-day warning?

Or is it better to reformat before releasing 3.0.2 so that it is easier
to backport future fixes?

> Also I am attaching a simple script I used to check the formated code.
> This scripts removes any space, tabs and newlines from the original file
> and the formated file, and compare their md5 signatures.This script
> requires the tr and md5sum utilities. I test it only on a linux system.
>
> This script can not detect bad formated code but maybe can detect bad
> modifications (eg source code blocks removal) on source code.
>
> Running this script I found 5 files with different md5 signatures but
> all of these files had formating modifications similar to the following:
> From
> if (i<t) /*A comment*/
> {
> ...
> }
> To
> if (i<t) { /*A comment*/
> ...
> }

Ha! Who would have thought that such transpositions are possible? I
guess we need to strip not just whitespace, but comments as well (which
is more difficult) for the MD5 test to work 100%. I would not spend time
on that now.

Thank you,

Alex.
Received on Thu Feb 21 2008 - 22:39:33 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 01 2008 - 12:00:09 MST