[dmd-internals] LF and CRLF on git

Jason House jason.james.house at gmail.com
Wed Jan 16 14:54:08 PST 2013


On Jan 16, 2013, at 4:34 PM, Leandro Lucarella <luca at llucax.com.ar> wrote:
> 
> While you're at it, you could also add some checks for other common
> white space errors. The sample pre-commit hook that comes with each
> repository have this check enabled, you just have to enable that hook by
> renaming it from pre-commit.sample to just pre-commit. Then you have to
> adjust the git config core.whitespace to whatever you want to check
> (there are several options, see git config --help for details).
> Unfortunately those checks don't include either the CRLF check or the
> "all spaces" (there is an option to check the opposite, that only tab is
> used for indentation), but it cover other common errors as trailing
> white spaces.

If there's going to be advanced validation, maybe it's better to create a formatting tool similar to gofmt. If passing a source file through it alters the file, it fails. The tool can be shared and could help establish a standard format for D code (or at least Phobos code).

I've never used gofmt, but did find the following link online:
http://golangtutorials.blogspot.com/2011/06/formatting-go-code-with-gofmt.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20130116/dcef8b8a/attachment.html>


More information about the dmd-internals mailing list