gnewsense-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnewsense-dev] Debderive


From: Stayvoid
Subject: Re: [Gnewsense-dev] Debderive
Date: Thu, 1 Mar 2012 02:29:54 +0300

> I had a closer look at this. It does what it's supposed to do. As for style, 
> please keep line
> length under 80 characters as described in the Python style guide [1]. Could 
> you rewrite it
> taking that into account?

diff3_1_2vsorig.txt or http://pastebin.com/raw.php?i=t2tC3TqA

This one fixes several things:
1) the length of the lines (72 for the comments and 79 for the rest).
(Should it count spaces?);
2) removes spaces from the end of the lines. (Does it really matter?);
3) replaces print >> sys.stderr with sys.stderr.write().

I'm not sure that I did it right for the docs and comments.
What style is the best?
1.
+    This is a suite that can be added to a distribution, i.e. packages
+    from it complement the principal "distribution" suite.
+    A supplementary suite usually provides newer package versions or
+    extra functionality (e.g. a multimedia suite)."""

2.
+    This is a suite that can be added to a distribution, i.e. packages
+    from it complement the principal "distribution" suite. A
+    supplementary suite usually provides newer package versions or
+    extra functionality (e.g. a multimedia suite)."""

(I've changed the second line.)

According to the typographic tradition, an article shouldn't stay
without a noun at the end of the line.
But maybe it's OK for the code.

Is there a guide for this?

Maybe we should get rid of backslashes. What do you think?
"Long lines can be broken over multiple lines by wrapping expressions
in parentheses.
These should be used in preference to using a backslash for line
continuation." [a]

I put this code in my .emacs file:
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(setq whitespace-line-column 79)
(global-whitespace-mode t)

It will hightlight everything longer then 79 chars.

There is also a test, but it doesn't cover everything.
debderiver_patch3_1_2_tester.py or http://pastebin.com/raw.php?i=fUhZY3t6

[a] http://www.python.org/dev/peps/pep-0008/

Attachment: diff3_1_2vsorig.txt
Description: Text document

Attachment: debderiver_patch3_1_2_tester.py
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]