Policies » Historie » Verze 6
Jan Pašek, 2021-03-03 13:03
1 | 3 | Jan Pašek | h1. Project convention |
---|---|---|---|
2 | 1 | Jan Pašek | |
3 | h2. Git |
||
4 | 6 | Jan Pašek | |
5 | 5 | Jan Pašek | ------------------------------------------------------ |
6 | 2 | Jan Pašek | |
7 | 1 | Jan Pašek | h2. RedMine |
8 | 6 | Jan Pašek | |
9 | 5 | Jan Pašek | ------------------------------------------------------ |
10 | 2 | Jan Pašek | |
11 | 4 | Jan Pašek | h2. Code |
12 | 5 | Jan Pašek | |
13 | ------------------------------------------------------ |
||
14 | |||
15 | h3. General |
||
16 | |||
17 | * Code and all comments shall be written in English |
||
18 | * Python docstrings (bellow function header) shall be created for all functions describing the purpose, inputs and outputs |
||
19 | * Avoid using names that are too general or too wordy. Strike a good balance between the two |
||
20 | * When using CamelCase names, capitalize all letters of an abbreviation (e.g. HTTPServer) |
||
21 | |||
22 | h3. Packages |
||
23 | |||
24 | * Package names should be all lower case |
||
25 | * When multiple words are needed, an underscore should separate them |
||
26 | * It is usually preferable to stick to 1-word names |
||
27 | |||
28 | h3. Modules |
||
29 | |||
30 | * Module names should be all lower case |
||
31 | * When multiple words are needed, an underscore should separate them |
||
32 | * It is usually preferable to stick to 1 word names |
||
33 | |||
34 | h3. Classes |
||
35 | |||
36 | * Class names should follow the UpperCaseCamelCase convention |
||
37 | * Exception classes should end in “Error” |
||
38 | |||
39 | h3. Global Variables |
||
40 | |||
41 | * Global variables should be all lowercase |
||
42 | * Words in a global variable name should be separated by an underscore |
||
43 | |||
44 | h3. Instance Variables |
||
45 | |||
46 | * Instance variable names should be all lower case |
||
47 | * Words in an instance variable name should be separated by an underscore |
||
48 | * Non-public instance variables should begin with a single underscore |
||
49 | * If an instance name needs to be mangled (interpreter rewrites the name in order to avoid name conflicts in subclasses), two underscores may begin its name |
||
50 | |||
51 | h3. Methods |
||
52 | |||
53 | * Method names should be all lower case |
||
54 | * Words in a method name should be separated by an underscore |
||
55 | * Non-public method should begin with a single underscore |
||
56 | * If a method name needs to be mangled, two underscores may begin its name |
||
57 | |||
58 | h3. Method Arguments |
||
59 | |||
60 | * Instance methods should have their first argument named ‘self’. |
||
61 | * Class methods should have their first argument named ‘cls’ |
||
62 | |||
63 | h3. Functions |
||
64 | |||
65 | * Function names should be all lower case |
||
66 | * Words in a function name should be separated by an underscore |
||
67 | |||
68 | h3. Constants |
||
69 | |||
70 | * Constant names must be fully capitalized |
||
71 | * Words in a constant name should be separated by an underscore |