git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Conforming to pep8

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 9, 2014, 07:18 UTC
Message-ID
<536c815ee0b9c_182dd0d3104b@nysa.notmuch>
In-Reply-To
<20140509051623.GB9051@wst420>
William Giokas wrote:
Show 8 quoted lines
> On Thu, May 08, 2014 at 11:36:29PM -0500, Felipe Contreras wrote:
> > William Giokas wrote:
> > > E401: Multi-line imports seems like something that would just be
> > > changing one line
> > 
> > Yes, and make the code very annoying.
> 
> It's 1 extra line in git-remote-hg, and 4 lines in git-remote-bzr.
Ah, it refers to the '^import *' not '^from x import'. That's fine then.
Show 26 quoted lines
> > > E302: Blank lines don't seem to be that hard to do either. That can even
> > > be automated quite reliably. It shouldn't detract from the readability,
> > > juts makes the file a bit longer.
> > 
> > The problem is not that it's hard to do, the problem is that it makes
> > the code uglier.
> 
> I would disagree, but this is one of the less important things.
> 
> > > E20{1,2,3}: Extra whitespace is something that just makes things more
> > > consistent and readable.
> > 
> > I don't see how this:
> > 
> >   {'100755': 'x', '120000': 'l'}
> > 
> > Is more readable than this:
> > 
> >   { '100755': 'x', '120000': 'l' }
> > 
> > No strong opinion on this one though.
> 
> It's not so much that it's wrong or less readable, but there is
> inconsistency on this one and I'd err pep8. Again, will send a patch to
> your tree for you to review, though it looks like you mostly fixed this
> in [1].

I don't see inconsistency within the script. All the hashes are in the form of { content }.

Show 15 quoted lines
> > > >   max-line-length = 160
> > > 
> > > The standard states that this should, at most, be increased to a value
> > > between 80 and 100.
> > 
> > And why's that?
> > 
> > This has been discussed many times in the LKML, and the end result is
> > that we don't live in the 60's, our terminals are not constrained to 60
> > characters. Going beyond 100 is fine.
> 
> Fair enough. At the same time, it'd only change 14 lines in the current
> git.git tree and would probably increase the readability of some of the
> sections. I noticed that some of the changes in the referenced patch
> actually fixed this on a few lines as well.

If the result is not so horrible I would consider this, otherwise I'll just ignore the warning.

-- 
Felipe Contreras
Previous: William GiokasNext: William Giokas
Message 8 of 14 in “Conforming to pep8”
  1. William GiokasMay 9, 2014
  2. Jonathan NiederMay 9, 2014
  3. Michael HaggertyMay 9, 2014
  4. Felipe ContrerasMay 9, 2014
  5. William GiokasMay 9, 2014
  6. Felipe ContrerasMay 9, 2014
  7. William GiokasMay 9, 2014
  8. Felipe ContrerasMay 9, 2014
  9. William GiokasMay 9, 2014
  10. Felipe ContrerasMay 9, 2014
  11. William GiokasMay 9, 2014
  12. W. Trevor KingMay 9, 2014
  13. Felipe ContrerasMay 9, 2014
  14. John KeepingMay 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.