2019-12-15 23:17:28 +01:00
|
|
|
[mypy]
|
2021-10-04 07:05:15 +02:00
|
|
|
python_version = 3.9
|
2019-12-20 06:07:40 +01:00
|
|
|
no_strict_optional = true
|
|
|
|
show_error_codes = true
|
2020-02-27 04:27:58 +01:00
|
|
|
disallow_untyped_decorators = True
|
|
|
|
warn_redundant_casts = True
|
|
|
|
warn_unused_configs = True
|
2020-08-02 02:29:25 +02:00
|
|
|
check_untyped_defs = true
|
2021-02-02 15:00:29 +01:00
|
|
|
disallow_untyped_defs = True
|
2020-08-03 02:26:40 +02:00
|
|
|
strict_equality = true
|
2019-12-15 23:17:28 +01:00
|
|
|
|
2021-04-06 09:07:38 +02:00
|
|
|
[mypy-aqt.operations.*]
|
2021-03-19 10:15:17 +01:00
|
|
|
no_strict_optional = false
|
undoable ops now return changes directly; add new *_ops.py files
- Introduced a new transact() method that wraps the return value
in a separate struct that describes the changes that were made.
- Changes are now gathered from the undo log, so we don't need to
guess at what was changed - eg if update_note() is called with identical
note contents, no changes are returned. Card changes will only be set
if cards were actually generated by the update_note() call, and tag
will only be set if a new tag was added.
- mw.perform_op() has been updated to expect the op to return the changes,
or a structure with the changes in it, and it will use them to fire the
change hook, instead of fetching the changes from undo_status(), so there
is no risk of race conditions.
- the various calls to mw.perform_op() have been split into separate
files like card_ops.py. Aside from making the code cleaner, this works
around a rather annoying issue with mypy. Because we run it with
no_strict_optional, mypy is happy to accept an operation that returns None,
despite the type signature saying it requires changes to be returned.
Turning no_strict_optional on for the whole codebase is not practical
at the moment, but we can enable it for individual files.
Still todo:
- The cursor keeps moving back to the start of a field when typing -
we need to ignore the refresh hook when we are the initiator.
- The busy cursor icon should probably be delayed a few hundreds ms.
- Still need to think about a nicer way of handling saveNow()
- op_made_changes(), op_affects_study_queue() might be better embedded
as properties in the object instead
2021-03-16 05:26:42 +01:00
|
|
|
|
2021-02-02 15:00:29 +01:00
|
|
|
[mypy-aqt.winpaths]
|
|
|
|
disallow_untyped_defs=false
|
2020-05-04 05:23:08 +02:00
|
|
|
[mypy-aqt.mpv]
|
2021-02-02 15:00:29 +01:00
|
|
|
disallow_untyped_defs=false
|
2020-05-04 05:23:08 +02:00
|
|
|
ignore_errors=true
|
2020-05-04 13:52:48 +02:00
|
|
|
|
2020-12-18 07:52:00 +01:00
|
|
|
[mypy-pyaudio]
|
|
|
|
ignore_missing_imports = True
|
2019-12-15 23:17:28 +01:00
|
|
|
[mypy-win32file]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-win32pipe]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pywintypes]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-winerror]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-distro]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-win32api]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-xml.dom]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-psutil]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-bs4]
|
|
|
|
ignore_missing_imports = True
|
2019-12-15 23:51:38 +01:00
|
|
|
[mypy-pythoncom]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-win32com]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-send2trash]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-markdown]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-jsonschema.*]
|
|
|
|
ignore_missing_imports = True
|
2020-11-02 06:02:30 +01:00
|
|
|
[mypy-anki._rsbridge]
|
2020-01-02 10:43:19 +01:00
|
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-PyQt5.sip]
|
2019-12-22 10:28:36 +01:00
|
|
|
ignore_missing_imports = True
|
2020-11-01 05:26:58 +01:00
|
|
|
[mypy-PyQt5.*]
|
|
|
|
ignore_errors = True
|
2021-10-05 05:53:01 +02:00
|
|
|
ignore_missing_imports = True
|
2020-01-21 11:42:06 +01:00
|
|
|
[mypy-win32com.client]
|
|
|
|
ignore_missing_imports = True
|
2020-01-31 04:45:25 +01:00
|
|
|
[mypy-darkdetect]
|
|
|
|
ignore_missing_imports = True
|
2020-05-08 09:29:09 +02:00
|
|
|
[mypy-socks]
|
|
|
|
ignore_missing_imports = True
|
2021-06-26 03:33:35 +02:00
|
|
|
[mypy-stringcase]
|
|
|
|
ignore_missing_imports = True
|
2022-08-19 01:54:54 +02:00
|
|
|
[mypy-certifi]
|
|
|
|
ignore_missing_imports = True
|
2020-05-04 13:52:48 +02:00
|
|
|
|
|
|
|
[mypy-aqt.forms.*]
|
2021-10-05 05:18:43 +02:00
|
|
|
disallow_untyped_defs = false
|
|
|
|
|
2021-02-02 15:00:29 +01:00
|
|
|
[mypy-anki.*]
|
|
|
|
disallow_untyped_defs=false
|
2021-10-05 01:41:26 +02:00
|
|
|
|
|
|
|
[mypy-PyQt6.*]
|
2021-10-05 05:18:43 +02:00
|
|
|
ignore_errors = True
|
|
|
|
ignore_missing_imports = True
|