[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Enforcing Code Style

From: John Aldridge <john.aldridge_at_informatix.co.uk>
Date: Thu, 28 Aug 2008 12:37:57 +0100

Tom Browder 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 have another use case related to this: HTML documents. The problem is
that we have various HTML editors in use, all of which have different
ideas about how to layout HTML. The result is that diffs & blame are
pretty much useless. A custom diff tool might help a bit, but blame will
still be a problem.

Apart from just living with the problem, there seem to be a few options:

a) Tell everyone to use a standard HTML editor. It will be difficult to
reach agreement on one which everyone is happy to use and which doesn't
cost too much, though!

b) Tell people to edit HTML with a text editor. That will eliminate
random formatting changes, but not everyone is HTML literate, and even
those who are would welcome some syntax checking assistance!

c) Implement a pre-commit hook which checks that the data is already in
some standard format as produced by htmltidy, and rejects the commit if not.

It would be nice, though, to be able to run htmltidy automatically as
part of the commit process. Whilst I wouldn't want to run a pretty
printer over (e.g.) C++ source code -- people are entitled to have their
carefully considered code layout respected, IMO -- I think the issues
are different with HTML where people generally don't look at the raw
text even when editing a document.

It would be nicest if this could be done server-side, because otherwise
there might be problems with people using different repositories with
different canonicalization rules, and because there are otherwise client
configuration and deployment issues.

-- 
Cheers,
John
---------------------------------------------------------------------
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-28 13:38:22 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.