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
Required fixes:
- CallbackQuery is now comparable.
- Message.effective_attachment, Message.photo,
Message.new_chat_members, Message.new_chat_photo &
Game.text_entitties semantic fixes - when they are not defined,
return an empty list.
- Docstring fix to Update class.
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.rst
+28-19Lines changed: 28 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
How To Contribute
2
-
===================
2
+
=================
3
3
4
4
Every open source project lives from the generous help by contributors that sacrifice their time and ``python-telegram-bot`` is no different. To make participation as pleasant as possible, this project adheres to the `Code of Conduct`_ by the Python Software Foundation.
5
5
6
6
Setting things up
7
-
-------------------
7
+
-----------------
8
8
9
9
1. Fork the ``python-telegram-bot`` repository to your GitHub account.
10
10
@@ -35,7 +35,7 @@ Setting things up
35
35
$ pre-commit install
36
36
37
37
Finding something to do
38
-
###################
38
+
#######################
39
39
40
40
If you already know what you'd like to work on, you can skip this section.
41
41
@@ -44,7 +44,7 @@ If you have an idea for something to do, first check if it's already been filed
44
44
Another great way to start contributing is by writing tests. Tests are really important because they help prevent developers from accidentally breaking existing code, allowing them to build cool things faster. If you're interested in helping out, let the development team know by posting to the `developers' mailing list`_, and we'll help you get started.
45
45
46
46
Instructions for making a code change
47
-
####################
47
+
#####################################
48
48
49
49
The central development branch is ``master``, which should be clean and ready for release at any time. In general, all changes should be done as feature branches based off of ``master``.
50
50
@@ -89,7 +89,7 @@ Here's how to make a one-off code change.
89
89
90
90
.. code-block::
91
91
92
-
$ nosetests -v
92
+
$ pytest -v
93
93
94
94
- To actually make the commit (this will trigger tests for yapf, lint and pep8 automatically):
95
95
@@ -129,19 +129,19 @@ Here's how to make a one-off code change.
129
129
130
130
.. code-block:: bash
131
131
132
-
$ git checkout your-branch-name
133
-
$ git fetch upstream
134
-
$ git merge upstream/master
135
-
$ ...[fix the conflicts]...
136
-
$ ...[make sure the tests pass before committing]...
137
-
$ git commit -a
138
-
$ git push origin your-branch-name
132
+
$ git checkout your-branch-name
133
+
$ git fetch upstream
134
+
$ git merge upstream/master
135
+
$ ...[fix the conflicts]...
136
+
$ ...[make sure the tests pass before committing]...
137
+
$ git commit -a
138
+
$ git push origin your-branch-name
139
139
140
140
- If after merging you see local modified files in ``telegram/vendor/`` directory, that you didn't actually touch, that means you need to update submodules with this command:
141
141
142
142
.. code-block:: bash
143
143
144
-
$ git submodule update --init --recursive
144
+
$ git submodule update --init --recursive
145
145
146
146
- At the end, the reviewer will merge the pull request.
147
147
@@ -155,20 +155,29 @@ Here's how to make a one-off code change.
155
155
7. **Celebrate.** Congratulations, you have contributed to ``python-telegram-bot``!
156
156
157
157
Style commandments
158
-
---------------------
158
+
------------------
159
159
160
160
Specific commandments
161
161
#####################
162
162
163
163
- Avoid using "double quotes" where you can reasonably use 'single quotes'.
164
164
165
-
AssertEqual argument order
166
-
######################
165
+
Assert comparison order
166
+
#######################
167
167
168
-
- assertEqual method's arguments should be in ('actual', 'expected') order.
168
+
- assert statements should compare in **actual** == **expected** order.
169
+
For example (assuming ``test_call`` is the thing being tested):
170
+
171
+
.. code-block:: python
172
+
173
+
# GOOD
174
+
assert test_call() ==5
175
+
176
+
# BAD
177
+
assert5== test_call()
169
178
170
179
Properly calling callables
171
-
#######################
180
+
##########################
172
181
173
182
Methods, functions and classes can specify optional parameters (with default
174
183
values) using Python's keyword arg syntax. When providing a value to such a
@@ -186,7 +195,7 @@ This gives us the flexibility to re-order arguments and more importantly
186
195
to add new required arguments. It's also more explicit and easier to read.
187
196
188
197
Properly defining optional arguments
189
-
########################
198
+
####################################
190
199
191
200
It's always good to not initialize optional arguments at class creation,
192
201
instead use ``**kwargs`` to get them. It's well known Telegram API can
0 commit comments