From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 29B9B1387FD for ; Sun, 30 Mar 2014 00:22:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3ABBE0A43; Sun, 30 Mar 2014 00:22:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 20E25E0A43 for ; Sun, 30 Mar 2014 00:22:53 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2857833FDA8 for ; Sun, 30 Mar 2014 00:22:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id A6241188A2 for ; Sun, 30 Mar 2014 00:22:49 +0000 (UTC) From: "Alexander Berntsen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexander Berntsen" Message-ID: <1395923521.ec8c4f4cd54f9311db3b8e6f634a77ec57674e3d.bernalex@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: / X-VCS-Repository: proj/portage X-VCS-Files: DEVELOPING X-VCS-Directories: / X-VCS-Committer: bernalex X-VCS-Committer-Name: Alexander Berntsen X-VCS-Revision: ec8c4f4cd54f9311db3b8e6f634a77ec57674e3d X-VCS-Branch: master Date: Sun, 30 Mar 2014 00:22:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1e98be22-e3aa-4223-a4cd-98820eeef153 X-Archives-Hash: e6cdd065f493619ec16b06986cad9132 commit: ec8c4f4cd54f9311db3b8e6f634a77ec57674e3d Author: Alexander Berntsen gentoo org> AuthorDate: Thu Mar 27 12:32:01 2014 +0000 Commit: Alexander Berntsen gentoo org> CommitDate: Thu Mar 27 12:32:01 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ec8c4f4c DEVELOPING: Cap at 72 columns --- DEVELOPING | 73 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/DEVELOPING b/DEVELOPING index 40b4ca2..1f5087a 100644 --- a/DEVELOPING +++ b/DEVELOPING @@ -1,37 +1,39 @@ Code Guidelines --------------- -A few code guidelines to try to stick to, please comment if none of these make -sense, they are pretty basic and mostly apply to old code. However for people -who are looking at current code, they make take up bad habits that exist in the -current codebase. +A few code guidelines to try to stick to, please comment if none of +these make sense, they are pretty basic and mostly apply to old code. +However for people who are looking at current code, they make take up +bad habits that exist in the current codebase. Python Version -------------- -Python 2.6 is the minimum supported version, since it is the first version to -support Python 3 syntax. All exception handling should use Python 3 'except' -syntax, and the print function should be used instead of Python 2's print -statement (from __future__ import print_function). +Python 2.6 is the minimum supported version, since it is the first +version to support Python 3 syntax. All exception handling should use +Python 3 'except' syntax, and the print function should be used instead +of Python 2's print statement (from __future__ import print_function). Dependencies ------------ -Python and Bash should be the only hard dependencies. Any other dependencies, -including external Python modules that are not included with Python itself, -must be optionally enabled by run-time detection. +Python and Bash should be the only hard dependencies. Any other +dependencies, including external Python modules that are not included +with Python itself, must be optionally enabled by run-time detection. Tabs ---- -The current code uses tabs, not spaces. Keep whitespace usage consistent -between files. New files should use tabs. Space is sometimes used for -indentation in Python code. Tab stop should for this reason be set to 4. +The current code uses tabs, not spaces. Keep whitespace usage +consistent between files. New files should use tabs. Space is +sometimes used for indentation in Python code. Tab stop should for this +reason be set to 4. Line-Wrapping ------------- -Lines should typically not be longer than 80 characters; if they are an attempt -should be made to wrap them. Move code to the line below and indent once (\t). +Lines should typically not be longer than 80 characters; if they are an +attempt should be made to wrap them. Move code to the line below and +indent once (\t). errors.append(MalformedMetadata( errors.DESCRIPTION_TOO_LONG_ERROR % \ @@ -45,9 +47,10 @@ errors.append(MalformedMetadata( (length, max_desc_len), attr='DESCRIPTION.toolong') -The mixing of tabs and spaces means other developers can't read what you did. -This is why the python peps state spaces over tabs; because with spaces the line -wrapping is always clear (but you cannot convert spaces as easily as tabwidth). +The mixing of tabs and spaces means other developers can't read what you +did. This is why the python peps state spaces over tabs; because with +spaces the line wrapping is always clear (but you cannot convert spaces +as easily as tabwidth). Comparisons ----------- @@ -78,9 +81,9 @@ Generally you can do two things here, if you are messing with defaults.. dict.get(foo, some_default) -will try to retrieve foo from dict, if there is a KeyError, will insert foo -into dict with the value of some_default. This method is preferred in cases where -you are messing with defaults: +will try to retrieve foo from dict, if there is a KeyError, will insert +foo into dict with the value of some_default. This method is preferred +in cases where you are messing with defaults: try: dict[foo] @@ -114,7 +117,8 @@ YES: NO: import os,sys,time -When importing from a module, you may import more than 1 thing at a time. +When importing from a module, you may import more than 1 thing at a +time. YES: from portage.module import foo, bar, baz @@ -139,9 +143,9 @@ NO: import sys Try not to import large numbers of things into the namespace of a module. -I realize this is done all over the place in current code but it really makes it -a pain to do code reflection when the namespace is cluttered with identifiers -from other modules. +I realize this is done all over the place in current code but it really +makes it a pain to do code reflection when the namespace is cluttered +with identifiers from other modules. YES: @@ -153,14 +157,15 @@ from portage.output import bold, create_color_func, darkgreen, \ green, nocolor, red, turquoise, yellow The YES example imports the 'output' module into the current namespace. -The negative here is having to use output.COLOR all over the place instead of -just COLOR. However it means during introspection of the current namespace -'green','red', 'yellow', etc. will not show up. - -The NO example just imports a set of functions from the output module. It is -somewhat annoying because the import line needs to be modified when functions -are needed and often unused functions are left in the import line until someone -comes along with a linter to clean up (does not happen often). +The negative here is having to use output.COLOR all over the place +instead of just COLOR. However it means during introspection of the +current namespace 'green','red', 'yellow', etc. will not show up. + +The NO example just imports a set of functions from the output module. +It is somewhat annoying because the import line needs to be modified +when functions are needed and often unused functions are left in the +import line until someone comes along with a linter to clean up (does +not happen often). Releases