You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/DEVELOPMENT.md
+56-14Lines changed: 56 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
1
# Development
2
2
3
-
## Getting started with development
3
+
Developers should read [the development section of the website](https://trino.io/development),
4
+
which covers things like development philosophy and contribution process.
5
+
6
+
*[Commits and pull requests](#commits-and-pull-requests)
7
+
*[Code style](#code-style)
8
+
9
+
## Getting started
4
10
5
11
Start by forking the repository and then modify the code in your fork.
6
12
@@ -16,18 +22,7 @@ With `-e` passed to `pip install` above pip can reference the code you are
16
22
modifying in the *virtual env*. That way, you do not need to run `pip install`
17
23
again to make your changes applied to the *virtual env*.
18
24
19
-
When the code is ready, submit a Pull Request.
20
-
21
-
### Code style
22
-
23
-
- For Python code, adhere to PEP 8.
24
-
- Prefer code that is readable over one that is "clever".
25
-
- When writing a Git commit message, follow these [guidelines](https://chris.beams.io/posts/git-commit/).
26
-
27
-
See also Trino's [guidelines](https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md).
28
-
Most of them also apply to code in trino-python-client.
29
-
30
-
### Running tests
25
+
## Running tests
31
26
32
27
`trino-python-client` uses [pytest](https://pytest.org/) for its tests. To run
33
28
only unit tests, type:
@@ -55,6 +50,54 @@ use `tox` (see the configuration in `tox.ini`):
55
50
$ tox
56
51
```
57
52
53
+
When the code is ready, submit a Pull Request.
54
+
55
+
## Commits and pull requests
56
+
57
+
See [Commits and pull requests](https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#commits-and-pull-requests) section from Trino.
58
+
59
+
## Code style
60
+
61
+
To run linting and formatting checks before opening a PR: `#TODO - fill this in`
62
+
63
+
In addition to that you should also adhere to the following:
64
+
65
+
### Readability
66
+
67
+
Prefer code that is readable over one that is "clever". The purpose of code
68
+
style rules is to maintain code readability and developer efficiency when
69
+
working with the code. All the code style rules explained below are good
70
+
guidelines to follow but there may be exceptional situations where we
71
+
purposefully depart from them. When readability and code style rule are at
72
+
odds, the readability is more important.
73
+
74
+
### Consistency
75
+
76
+
Keep code consistent with surrounding code where possible.
77
+
78
+
### Avoid mocks where possible
79
+
80
+
Do not use mocking libraries. These libraries encourage testing specific call
81
+
sequences, interactions, and other internal behavior, which we believe leads to
82
+
fragile tests. They also make it possible to mock complex interfaces or
83
+
classes, which hides the fact that these classes are not (easily) testable. We
84
+
prefer to write mocks by hand, which forces code to be written in a certain
85
+
testable style.
86
+
87
+
We also acknowledge that there is existing code which uses mocks but that
88
+
should not be taken as a reason increase reliance on mocks.
89
+
90
+
### Maintain production quality for test code
91
+
92
+
Maintain the same quality for production and test code.
93
+
94
+
### Avoid abbreviations
95
+
96
+
Please avoid abbreviations, slang or inside jokes as this makes harder for
97
+
non-native english speaker to understand the code. Very well known
98
+
abbreviations like `max` or `min` and ones already very commonly used across
99
+
the code base like `ttl` are allowed and encouraged.
100
+
58
101
## Releasing
59
102
60
103
-[Set up your development environment](#Getting-Started-With-Development).
@@ -86,4 +129,3 @@ $ tox
86
129
git push upstream master 0.123.0
87
130
```
88
131
- Send release announcement on the *#python-client* channel on [Trino Slack][trino-slack].
0 commit comments