On 8/22/08, Kevin Grover <kevin_at_kevingrover.net> wrote:
>
> On Fri, Aug 22, 2008 at 3:02 AM, Tom Browder <tom.browder_at_gmail.com> wrote:
>
> >
> > I think this has been discussed before, but I would appreciate any
> > ideas on how to minimize formatting changes from multiple developers
> > using different operating systems and different editors (and
> > settings).
...
> I would reformat all code upfront, in one step, and commit it with a comment
> along the lines of "Reformated with 'codeformat ARGS and OPTIONS'". If
> people reformat as they change things, it becomes impossible to tell what
> really changed. E.g. the actual code changed get eclipsed by the
> reformatting changes.
Good idea
.
> For day-to-day development, you can either _encourage_ developers to use the
> correct style in the future: this will be mostly automatic if your tools
> (editor) format the way you want.
That's been the problem--no control over editor settings, and folks
who have auto wrapping line editors that don't care about line
lengths. Yuch!
> And/or, you can add a pre-commit hook script that looks at each file in a
> commit: for each type to which your coding standards apply (i.e. source
...
> the same, the script dies with an error string "Source file XXXX is not in
> the correct coding style:" (you could also append the diff text from the
> compare). If you have a tool that just checks for coding style, you can
> also use that and die if it complains.
...
> The second approach can be a little draconian.
Yeah, but I bet it gets the attention of those with rogue editors.
> As an FYI, another nice reformatter is astyle (Artistic Style). I like it
> because it's standalone, configurable, and runs everywhere.
That's the one I'm thinking of, too. It sure should help us
cross-platform teams.
Thanks, Kevin.
-Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-23 00:05:47 CEST