git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Giokas <1007380@gmail.com>
To: git@vger.kernel.org
Subject: Conforming to pep8
Date: Thu, 8 May 2014 20:54:29 -0500	[thread overview]
Message-ID: <20140509015429.GA550@wst420> (raw)

[-- Attachment #1: Type: text/plain, Size: 3940 bytes --]

Hi all,

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::

    ./git-p4.py
    ./contrib/svn-fe/svnrdump_sim.py
    ./contrib/remote-helpers/git-remote-bzr
    ./contrib/hooks/multimail/post-receive
    ./contrib/hooks/multimail/migrate-mailhook-config
    ./contrib/hooks/multimail/git_multimail.py
    ./contrib/hooks/multimail/README
    ./contrib/hg-to-git/hg-to-git.py
    ./contrib/gitview/gitview
    ./contrib/fast-import/import-zips.py
    20      E101 indentation contains mixed spaces and tabs
    90      E111 indentation is not a multiple of four
    9       E112 expected an indented block
    47      E113 unexpected indentation
    1       E121 continuation line under-indented for hanging indent
    3       E122 continuation line missing indentation or outdented
    3       E124 closing bracket does not match visual indentation
    12      E125 continuation line with same indent as next logical line
    9       E126 continuation line over-indented for hanging indent
    4       E127 continuation line over-indented for visual indent
    63      E128 continuation line under-indented for visual indent
    4       E129 visually indented line with same indent as next logical line
    3       E131 continuation line unaligned for hanging indent
    37      E201 whitespace after '['
    30      E202 whitespace before ']'
    30      E203 whitespace before ':'
    37      E211 whitespace before '('
    10      E221 multiple spaces before operator
    14      E222 multiple spaces after operator
    8       E223 tab before operator
    1       E224 tab after operator
    35      E225 missing whitespace around operator
    6       E228 missing whitespace around modulo operator
    23      E231 missing whitespace after ','
    10      E251 unexpected spaces around keyword / parameter equals
    1       E261 at least two spaces before inline comment
    1       E262 inline comment should start with '# '
    37      E265 block comment should start with '# '
    1       E301 expected 1 blank line, found 0
    117     E302 expected 2 blank lines, found 1
    19      E303 too many blank lines (2)
    4       E401 multiple imports on one line
    220     E501 line too long (83 > 79 characters)
    5       E502 the backslash is redundant between brackets
    33      E701 multiple statements on one line (colon)
    11      E702 multiple statements on one line (semicolon)
    34      E703 statement ends with a semicolon
    9       E711 comparison to None should be 'if cond is None:'
    2       E713 test for membership should be 'not in'
    1022    W191 indentation contains tabs
    40      W601 .has_key() is deprecated, use 'in'
    1       W602 deprecated form of raising exception
    1       W603 '<>' is deprecated, use '!='
    1       W604 backticks are deprecated, use 'repr()'

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.

Thanks,
-- 
William Giokas | KaiSforza | http://kaictl.net/
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2014-05-09  1:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  1:54 William Giokas [this message]
2014-05-09  2:09 ` Conforming to pep8 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

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=20140509015429.GA550@wst420 \
    --to=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).