Skip to content
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

Integrate mypy #31

Open
evgfilim1 opened this issue Oct 28, 2022 · 0 comments
Open

Integrate mypy #31

evgfilim1 opened this issue Oct 28, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@evgfilim1
Copy link
Owner

evgfilim1 commented Oct 28, 2022

Start here

diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index 833fcde..77cf54c 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -45,6 +45,7 @@ jobs:
         run: |
           isort --check --diff userbot
           black --check --diff userbot
+          mypy userbot
 
       - name: Check message catalog template is up-to-date
         run: python potctl.py --diff
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 390cec5..41f7d7e 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,3 +1,5 @@
 Babel~=2.10.3
 black~=22.10.0
 isort~=5.10.1
+mypy~=0.982
+types-aiofiles~=22.1.0
diff --git a/pyproject.toml b/pyproject.toml
index bcb9333..e1c88f9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,3 +7,52 @@ line_length = 100
 py_version = '310'  # (2022-10-28) isort 5.10.1 doesn't support 3.11
 profile = 'black'
 known_first_party = ['userbot']
+
+[tool.mypy]
+# Config file
+warn_unused_configs = true
+
+# Import discovery
+namespace_packages = true
+
+# Platform configuration
+python_version = "3.11"
+
+# Disallow dynamic typing
+#disallow_any_explicit = true
+disallow_any_generics = true
+disallow_subclassing_any = true
+
+# Untyped definitions and calls
+disallow_untyped_calls = true
+disallow_untyped_defs = true
+disallow_incomplete_defs = true
+check_untyped_defs = true
+disallow_untyped_decorators = true
+
+# None and Optional handling
+no_implicit_optional = true
+
+# Configuring warnings
+warn_redundant_casts = true
+warn_unused_ignores = true
+warn_return_any = true
+warn_unreachable = true
+
+# Miscellaneous strictness flags
+local_partial_types = true
+# Pyrogram doesn't explicitly export some attributes, so this has to be disabled
+no_implicit_reexport = false
+strict_equality = true
+strict = true
+
+# Configuring error messages
+show_error_context = true
+show_column_numbers = true
+show_error_codes = true
+pretty = true
+
+# Advanced options
+plugins = [
+]
+warn_incomplete_stub = true
@evgfilim1 evgfilim1 added enhancement New feature or request help wanted Extra attention is needed labels Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant