Skip to content

Django 專案加入 Mypy 指南#5

Merged
kyomind merged 3 commits intomainfrom
mypy-django-guide
Sep 3, 2024
Merged

Django 專案加入 Mypy 指南#5
kyomind merged 3 commits intomainfrom
mypy-django-guide

Conversation

@kyomind
Copy link
Owner

@kyomind kyomind commented Sep 3, 2024

- Add `mypy` as a development dependency
- Add `django-stubs` as a development dependency

Signed-off-by: kyo <odinxp@gmail.com>
- Add a new configuration file for mypy with various settings
- Enable warnings for return types and untyped calls
- Exclude migrations directory and manage.py from checks
- Include Django-specific plugin configuration for mypy

Signed-off-by: kyo <odinxp@gmail.com>
- Update the string representation methods to include type hints for better clarity
- Remove an unused import in the tests file
- Add type hints to the request parameters and return types in the views file

Signed-off-by: kyo <odinxp@gmail.com>
@kyomind kyomind added 文章 文章更動的程式碼 Django-Tutorial Django-Tutorial 系列文章 labels Sep 3, 2024
@kyomind kyomind self-assigned this Sep 3, 2024
@kyomind kyomind merged commit 740dd8b into main Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Django-Tutorial Django-Tutorial 系列文章 文章 文章更動的程式碼

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant