From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
Daniel Barkalow <barkalow@iabervon.org>,
git@vger.kernel.org
Subject: Re: [PATCH] Add gitattributes file making whitespace checking pickier
Date: Sun, 10 Feb 2008 12:31:15 +0100 [thread overview]
Message-ID: <200802101231.16847.jnareb@gmail.com> (raw)
In-Reply-To: <7v8x1t5uk1.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>>> *.py whitespace=!indent,trail,space
>>> *.el whitespace=!indent,trail,space
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?
>>> fast-import/git-p4 whitespace=!indent,trail,space
>>
>> I would also exclude gitweb/gitweb.perl
>
> Why?
>
> As far as I can tell, Perl does not use Python/Elisp "indents
> are all whitespace" rule and neither does the script.
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.
> It also happens that I do not personally believe in "alignment
> with spaces" argument. If you accept W and a SP occupy the same
> horizontal space (which "alignment with spaces" assume), I do
> not think it is unreasonable to accept HT goes to the next
> column that is multiple of 8 places.
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
next prev parent reply other threads:[~2008-02-10 11:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-09 16:22 [PATCH] Add gitattributes file making whitespace checking pickier J. Bruce Fields
2008-02-09 17:56 ` Daniel Barkalow
2008-02-09 18:50 ` J. Bruce Fields
2008-02-09 19:05 ` J. Bruce Fields
2008-02-09 19:36 ` Jakub Narebski
2008-02-09 20:04 ` J. Bruce Fields
2008-02-09 20:22 ` Jakub Narebski
2008-02-09 23:39 ` J. Bruce Fields
2008-02-09 20:57 ` Junio C Hamano
2008-02-09 23:36 ` J. Bruce Fields
2008-02-09 23:45 ` Jakub Narebski
2008-02-10 4:01 ` Junio C Hamano
2008-02-10 11:31 ` Jakub Narebski [this message]
2008-02-10 21:52 ` Junio C Hamano
2008-02-10 10:52 ` Junio C Hamano
2008-02-10 18:56 ` J. Bruce Fields
2008-02-10 20:22 ` Daniel Barkalow
2008-02-10 21:47 ` Junio C Hamano
2008-02-10 22:34 ` Daniel Barkalow
2008-02-11 3:34 ` Junio C Hamano
2008-02-12 7:43 ` Brian Downing
2008-02-12 21:42 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200802101231.16847.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=barkalow@iabervon.org \
--cc=bfields@fieldses.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).