Skip to content

Commit

Permalink
tasks: Add mypy bot annotation task.
Browse files Browse the repository at this point in the history
  • Loading branch information
aero31aero committed Dec 4, 2017
1 parent 435921a commit 87a80d5
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions tasks/2017/mypy-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Let *file* be a file listed in the task that brought you here.
automated ones, so it's better for you to leave them for the tool to
migrate).

* Commit your changes with a commit message title `mypy: Use Python 3
* Commit your changes with a commit message titled `mypy: Use Python 3
 type syntax in <file>.`

After you've converted the annotations for all the files, Submit a pull request,
Expand All @@ -67,9 +67,48 @@ with title `mypy: Use Python 3 syntax for typing in <file>.`
http://zulip.readthedocs.io/en/latest/mypy.html is a helpful document, as is
just looking at other files in the project and seeing their annotations.

## General notes
#### General notes

`tools/test-all` runs most of the tests in Travis, but is somewhat slow.
`tools/run-mypy` runs just the mypy tests. You can also run
`tools/run-mypy file` on a particular file or directory, which is even faster,
but may not catch all the mistakes in that file.

### Task Type B

If you are not familiar with Zulip's interactive bots, please do the following
two tasks before attempting this task:

* [Learn about interactive bots, pt 1: running the helloworld bot.](https://codein.withgoogle.com/tasks/4753673148170240/)
* [Learn about interactive bots, pt 2: creating a message info bot.](https://codein.withgoogle.com/tasks/4787585941504000/)

Let *bot* be a bot listed in the task that brought you here.

* Write mypy annotations for all methods in the bot's main file and test
file, as well as any other python files in the directory
`python-zulip-api/zulip_bots/zulip_bots/bots/<bot>`.

* Add all the files you've just annotated to the `force_include` list in
`tools/run-mypy`. Test your local changes by running
`tools/test-static-analysis` and `tools/test-bots`.

* Commit your changes with a commit message titled `mypy: Add annotations for <bot>.`

After you've converted the annotations for all the listed bots, submit
a pull request with title `mypy: Add annotations for bots.` to the
https://github.com/zulip/python-zulip-api repository. Include a link to
the pull request when you submit your task on the GCI website.

*Completion criteria*:
* PASS_TRAVIS
* Mentor review. Mentors will review the code changes, as well as your
individual commits and commit messages.
* Mentors should also make sure that the modified method definitions
are line-wrapped properly and readable.

#### General notes:

Take a look at
[this commit](https://github.com/zulip/python-zulip-api/commit/8cd310493a99dc95a949983a45206c0de8980df1)
as an example of adding annotations to a bot.
http://zulip.readthedocs.io/en/latest/mypy.html is a helpful document as well.

0 comments on commit 87a80d5

Please sign in to comment.