Taranjeet Singh
64332d8816
Update linecoverage directory to linecoverage-report.
...
tools/provision.py: Create directory var/linecoverage-report.
tools/run-mypy: Update coverage dir to var/linecoverage-report.
2016-07-18 14:13:33 -07:00
Tim Abbott
5d990c28d0
Fix running run-mypy from any working directory.
2016-07-12 10:39:33 -07:00
Tim Abbott
b13eeae24c
Remove finbot from Zulip repository.
...
It's been split into its own repository,
https://github.com/zulip/finbot .
2016-07-08 16:15:55 -07:00
Eklavya Sharma
4cf7641ab1
zerver/tests/test_i18n.py: Ignore due to incomplete stubs.
...
In python 3, http.cookies has incomplete stubs.
2016-07-07 12:42:51 -07:00
Eklavya Sharma
6c3f1bb967
beanstalk.py: Encode and decode strings correctly.
2016-07-07 12:42:51 -07:00
Eklavya Sharma
26b8e7357a
zerver/views/messages.py: Operate on bytes in highlight_string.
2016-07-07 12:42:51 -07:00
Eklavya Sharma
83640ed0cd
runtornado.py: Ignore due to incorrect stubs.
2016-07-07 10:09:35 -07:00
Eklavya Sharma
6fd8906358
rename_stream.py: Fix broken code.
...
* get_realm returns None if no matching realm is present, but
create_stream.py assumed it raises Realm.DoesNotExist.
* encoded/decode strings properly.
2016-07-07 10:08:29 -07:00
Eklavya Sharma
c679c180f5
enqueue_file.py: Add type hint for mypy.
2016-07-07 10:07:51 -07:00
Eklavya Sharma
896c18a57b
email-mirror.py: Make it pass on mypy in python 3.
...
* Replace filter by list comprehension.
* Add '# type: ignore' to statements which use attributes from
modeule `posix`, since stubs for posix are missing on python 3.
2016-07-07 10:07:28 -07:00
Eklavya Sharma
17cb6e00bd
create_stream.py: Fix broken code.
...
* get_realm returns None if no matching realm is present, but
create_stream.py assumed it raises Realm.DoesNotExist.
* encoded/decode strings properly.
2016-07-07 10:06:39 -07:00
Eklavya Sharma
63d55bdd86
zerver/views/__init__.py: decode b64encoded ccache.
...
Convert b64encoded ccache to `str` before passing to
subprocess.check_call.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
628e45defc
zerver/lib/actions.py: Use text_type in truncate_ functions.
...
The functions truncate_content, truncate_body and truncate_topic
are only meant to be used on text strings. So change its
parameter types from AnyStr to text_type.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
976858f536
tornado_ioloop_logging.py: Ignore because of missing stub.
...
There is no stub for select.epoll on python 3. So ignore the
statement which uses it.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
9d2a539aaa
zerver/lib/notifications.py: Add hints for mypy.
...
Add type hints for mypy using isinstance in assert and if.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
5e81a4d93f
zerver/lib/email_mirror.py: Improve annotation in python 3.
...
Add asserts and if statements to help mypy.
2016-07-07 10:01:30 -07:00
Eklavya Sharma
06a7a6caee
zerver/lib/debug.py: Remove from mypy's exclude_py3.
...
traceback.print_stack doesn't have a stub yet. So ignore the
statement which uses it.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
6bb266d262
bugdown's __init__.py: Add python 3 compatibility.
...
* Use Response.text instead of Response.content.
* Make unescaping work on python 3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
05046d9288
bugdown's codehilite.py: Fix annotations in python 3 mode.
...
Many stubs in xml.etree.ElementTree use Union[str, bytes] as
return type. Mypy wants us to correctly handle each case. This
is correct, but not useful for us since we know that we'll always
get str. So force the return value to text_type, to supress mypy
errors.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
610f19c791
zerver/lib/camo.py: Type ignore statement with hex encode.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
6a63870136
zerver/decorator.py: Correctly encode/decode strings.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
4e698ab1f6
Remove zerver/lib/parallel.py from mypy's exclude_py3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
ce6ddd574a
zerver/lib/test_helpers.py: Replace os.path.walk by os.walk.
...
os.path.walk has been removed in python 3.
2016-07-06 11:49:55 -07:00
Eklavya Sharma
6505cbf2bf
zerver/lib/timeout.py: Replace isAlive by is_alive.
...
In threading.Thread, isAlive has been removed in python 3.
We should use is_alive instead.
2016-07-06 11:49:48 -07:00
Eklavya Sharma
dcd568960b
Add files to mypy's python 3 exclude list.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
b44ae38bff
tools/run-mypy: Add Python 3 mode.
2016-07-02 10:38:48 -07:00
Tim Abbott
5ce0637da9
run-mypy: Explode exclude lists to specific files.
2016-06-28 16:42:59 -07:00
Tim Abbott
56e7a2f6f3
Annotate zerver.migrations.
2016-06-28 16:38:33 -07:00
Tim Abbott
50f723f50b
Split test_narrow.py out of test_messages.py.
2016-06-21 12:25:08 -07:00
Tim Abbott
5b05644c95
Run mypy on zerver/tests/test_hooks.py.
2016-06-16 14:07:34 -07:00
Tim Abbott
6723525fd3
Annotate zerver/tests/tests.py.
2016-06-16 14:07:34 -07:00
Eklavya Sharma
553a9d0b75
tools/run-mypy: Exclude py files which have a pyi.
...
If a .py file has a corresponding .pyi stub file, exclude that
.py file from mypy.
2016-06-15 22:40:31 +05:30
Reid Barton
0b7852f081
Generate mypy coverage report for travis + coveralls.
2016-06-04 13:01:19 -07:00
Tim Abbott
37015fd7c5
Run mypy on zerver/lib/test_auth_backends.py.
2016-06-02 23:01:15 -07:00
Tim Abbott
8cef9675c8
Run mypy on zerver/lib/test_events.py.
2016-06-02 23:00:04 -07:00
Tim Abbott
e6d2b0cdbc
Run mypy on zerver/lib/test_unread.py.
2016-06-02 22:59:00 -07:00
Tim Abbott
f3b07ee9aa
Run mypy on zerver/lib/test_subs.py.
2016-06-02 22:57:07 -07:00
Tim Abbott
1bdbdd1110
Run mypy on test files where it already passes.
2016-06-02 22:53:28 -07:00
Conrad Dean
f8f2f45410
run-mypy: Add --linecount-report and --disallow-untyped-defs flags.
2016-06-02 18:45:52 -07:00
Greg Price
436499a129
Clean up some relative-path handling in lister using Git magic
...
This lets us cut out the line which hard-codes how deeply nested in
the tree the `run-mypy` script is, making it simpler to borrow these
scripts in other projects.
2016-05-30 20:01:37 -07:00
Reid Barton
8c6afac7cd
Add a stub file for request.py.
...
This stub file allows us to annotate view functions using the actual
types present in the bodies of the functions, rather than everything
having the type REQ.
2016-05-30 11:28:53 -07:00
Eklavya Sharma
d9c4be87d1
Make docs/conf.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
30892b2f99
Make makemessages.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
ea52fc05ed
Make zproject/urls.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
b210727e5c
Enable running tools/run-mypy on a subdirectory.
...
Previously tools/run-mypy could not run on a subdirectory properly
because run-mypy assumed exclude files to be in that subdirectory.
2016-05-24 13:24:15 -07:00
Eklavya Sharma
f3e25c68c7
Prevent tools/travis/mypy from failing silently.
...
Also improve the format of tools/travis/mypy's output.
Also add those files to the exclude list which are failing mypy check.
2016-05-21 12:37:04 +05:30
Eklavya Sharma
016a2faa23
Make zproject/local_settings.py pass mypy check.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
54759be785
Make zproject/local_settings_template.py pass mypy check.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
70a94a5b23
Expand zproject/ in mypy exclude list.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
6606c30355
Remove zilencer/models.py from mypy exclude list.
...
zilencer/models.py no longer gives an error on type checking with
mypy.
2016-05-18 17:10:18 +05:30