git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: William Giokas <1007380@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Conforming to pep8
Date: Fri, 9 May 2014 09:05:32 +0100	[thread overview]
Message-ID: <20140509080532.GD19464@serenity.lan> (raw)
In-Reply-To: <20140509015429.GA550@wst420>

On Thu, May 08, 2014 at 08:54:29PM -0500, William Giokas wrote:
> So I have been looking into the python code in the git tree recently
> (contrib and core tree) and noticed that almost none of the files fully
> conform to pep8. Now I'm not just saying this because I like the code to
> be clean, readable and easily parsed by humans, but also because this is
> laid out in the coding style document that is distributed with the git
> source::
> 
>     For Python scripts:
> 
>      - We follow PEP-8 (http://www.python.org/dev/peps/pep-0008/).
> 
> It's even the first thing that you see when you go looking for 'python'
> in the coding style document. I just ran every file in the tree that
> either ended in '.py' or had a python #!, and was greeted with a whole
> bunch of output::
[snip]
> Which is a whole bunch of errors and warnings thrown by pep8. Is pep8
> just getting put by the wayside? I would much rather have these scripts
> conform to that and have an actual coding style rather than just be a
> hodge-podge of different styles.

The note about PEP-8 was only added to the CodingStyle document fairly
recently, so it's not that it is "getting put by the wayside" but rather
that no one has tidied up what was there before this decision was made,
which gets caught under the catch all rule at the top of
CodingGuidelines:

 - Fixing style violations while working on a real change as a
   preparatory clean-up step is good, but otherwise avoid useless code
   churn for the sake of conforming to the style.

   "Once it _is_ in the tree, it's not really worth the patch noise to
   go and fix it up."
   Cf. http://article.gmane.org/gmane.linux.kernel/943020


Of course, pushing an "apply PEP-8 to the entire file" patch as the
first part of a series that does something else may be worse than fixing
up the style at a time when the script is not otherwise subject to
change.  I suspect the part of CodingGuidelines I quoted above applies
more to local style issues than "change indentation from tabs to spaces"
across an entire file.

      parent reply	other threads:[~2014-05-09  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  1:54 Conforming to pep8 William Giokas
2014-05-09  2:09 ` Jonathan Nieder
2014-05-09 14:33   ` Michael Haggerty
2014-05-09  2:10 ` Felipe Contreras
2014-05-09  3:57   ` William Giokas
2014-05-09  4:36     ` Felipe Contreras
2014-05-09  5:16       ` William Giokas
2014-05-09  7:18         ` Felipe Contreras
2014-05-09  7:28           ` William Giokas
2014-05-09  7:35             ` Felipe Contreras
2014-05-09  7:44               ` William Giokas
2014-05-09 16:01                 ` W. Trevor King
2014-05-09 16:14                   ` Felipe Contreras
2014-05-09  8:05 ` John Keeping [this message]

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=20140509080532.GD19464@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=1007380@gmail.com \
    --cc=git@vger.kernel.org \
    /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).