15 |
Issues |
Issues |
16 |
====== |
====== |
17 |
|
|
18 |
- our \*.java have the license attached to every file. Is that necessary? |
- our \*.java have the license attached to every file. Is that necessary? |
19 |
|
|
20 |
RESOLVED: Yes, according to FSF. |
RESOLVED: Yes, according to FSF. |
21 |
|
|
22 |
- should we have automatic tests for enforcing parts of the standard? |
- should we have automatic tests for enforcing parts of the standard? |
23 |
|
|
24 |
|
At least for the most trivial ones (rcsid, tab check, imports, class names). |
25 |
|
Failing tests will clearly tell what the developer did wrong. |
26 |
|
|
27 |
- should the rcs id variable be "rcsid" or "rcsId" ? |
- should the rcs id variable be "rcsid" or "rcsId" ? |
28 |
|
|
29 |
|
Probably rcsid, for consistency's sake, since it's used in our java files -- note |
30 |
|
also item 10. in Changes. |
31 |
|
|
32 |
|
For what it's worth, PEP008 recommends __version__ for this. |
33 |
|
|
34 |
- should all code and data really be in classes? If so, why? |
- should all code and data really be in classes? If so, why? |
35 |
|
|
36 |
|
RESOLVED: No. Rule 6 modified to catch the idea better. |
37 |
|
|
38 |
- should Tabs be allowed or not? |
- should Tabs be allowed or not? |
39 |
|
|
40 |
Perhaps a conversion tool at "make committable"? |
Perhaps a conversion tool at "make committable"? |
59 |
- Prefer "from foo import bar" to "from foo import \*". |
- Prefer "from foo import bar" to "from foo import \*". |
60 |
- No more than one import package in one line, except when importing gzz |
- No more than one import package in one line, except when importing gzz |
61 |
and java:: |
and java:: |
62 |
|
|
63 |
import os, sys # Preferably no. |
import os, sys # Preferably no. |
64 |
|
|
65 |
import os # Yes. |
import os # Yes. |
66 |
import sys |
import sys |
67 |
|
|
68 |
import gzz, java # Yes. |
import gzz, java # Yes. |
69 |
|
|
70 |
|
|
71 |
5. Imports should be grouped in the following order: |
5. Imports should be grouped in the following order: |
72 |
|
|
75 |
- java imports |
- java imports |
76 |
- gzz imports |
- gzz imports |
77 |
|
|
78 |
6. All code and data should preferably reside inside a class. |
6. Code should be structured so that it can be imported and re-used, for example by |
79 |
|
putting state in classes instead of the module namespace. Executable code |
80 |
|
in module namespace is discouraged -- except for "if __name__=='__main__':" |
81 |
|
|
82 |
|
7. Prefer list comprehensions to iterations, especially when dealing with lists. |
83 |
|
|
84 |
|
8. Class names are CapitalizedWords. |
85 |
|
|
86 |
|
9. Class methods and attributes are mixedCase. |
87 |
|
|
88 |
|
10. Functions are lower_case_with_underscores, variables are lowercase. |
89 |
|
|
90 |
|
11. Tab-size is 8 (will be conveted to spaces by make committable), indentation |
91 |
|
at 4 spaces. |
92 |
|
|
93 |
7. Class names are CapitalizedWords. |
12. Never use tabs. |
94 |
|
|
|
8. Class methods and attributes are mixedCase. |
|
95 |
|
|
96 |
9. Tab-size is 8 (will be conveted to spaces by make committable), indentation |
Notes |
97 |
at 4 spaces. |
===== |
98 |
|
|
99 |
10. Never use tabs. |
- items 8-10 are arbitrary choices for the sake of consistency |
100 |
|
|
101 |
|
- "A Foolish Consistency is the Hobgoblin of Little Minds" - Guido van Rossum |
102 |
|
|
103 |
|
|
104 |
References |
References |