-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure mypy #1243
Configure mypy #1243
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,25 @@ line_length = 100 | |
force_sort_within_sections = true | ||
# Combines "as" imports on the same line | ||
combine_as_imports = true | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
show_error_codes = true | ||
disable_error_code = ["attr-defined", "var-annotated"] | ||
follow_imports = "skip" # Don't follow imports into other files. This should be removed once all type errors have been resolved. | ||
exclude = [ | ||
"^dandiapi/api/admin.py", | ||
"^dandiapi/api/mail.py", | ||
"^dandiapi/api/tests/", | ||
"^dandiapi/api/management/", | ||
"^dandiapi/api/migrations/", | ||
"^dandiapi/api/models/", | ||
"^dandiapi/api/tasks/", | ||
"^dandiapi/api/views/", | ||
] | ||
Comment on lines
+20
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, I've excluded all files and directories that have type errors. I'll make follow up PRs where I fix the type errors in each of these and remove the corresponding entry from |
||
|
||
# Re-enable these when https://github.com/typeddjango/django-stubs/issues/417 is fixed. | ||
# plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] | ||
|
||
# [tool.django-stubs] | ||
# django_settings_module = "dandiapi.settings" | ||
Comment on lines
+31
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DANDI does use I agree that due to the lack of proper support, it's safer to disable these plugins for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two error cases produced a lot of type errors, many of which were incorrect because of django typing stubs not working. I've disabled them for now, and if django typing stubs ever get integrated with
django-configurations
properly, we can re-enable them.