Re: [PATCH] Add gitattributes file making whitespace checking pickier

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: J. Bruce Fields <bfields@...>, Daniel Barkalow <barkalow@...>, <git@...>
Date: Sunday, February 10, 2008 - 7:31 am

Junio C Hamano wrote:

Emacs Lisp is (like Perl, and contrary to Python) whitespace agnostic,
so here you just agree on historical usage. In this case the same
should IMHO be done for gitweb/gitweb.perl in main .gitattributes.

:<: checks contrib/emacs/git.el :>:

Hmmm... it looks like git.el uses only spaces, both for indent
and for align, with some spurious TABS happening.

If you allow this, couldn't you allow also for the gitweb.perl?


Elisp is also whitespace agnostic, but like in Perl it can contain
here-docs, and heredoc-like docstring; I'm not sure about whitespace
rules for that.

 
My argument is that when you change tab-width (and basic-offset), with
"tabs for indent, spaces for align" you don't have source get out of 
align. And not everybody uses large screens, and large resolution.

Besides there is also purely theoretical argument of consistency.
When using tabs also for align, it is in prectice align with tabs
_and spaces_, e.g.:

------>|if (expression ||
------>|____expression) {

or

------>|print "something" .
------>|______"something";

or

------>|$date{'mday-time'} = sprintf "%d %s %02d:%02d",
------>|------>|------>|_____$mday, $months[$mon], $hour ,$min;

where leading tab is marked as "------>|", and leading space as "_".


The argument for using tabs for align is that it is easy to check 
programatically for those kind of whitespace errors, and that editors 
do that. But lacking tools or misconfigured tools shouldn't IMHO be 
cause of selecting a coding style / choosing a policy.

-- 
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Add gitattributes file making whitespace checkin..., Jakub Narebski, (Sun Feb 10, 7:31 am)