Skip to content

Commit 4c72f9a

Browse files
committed
Add mypy
1 parent 49ebd81 commit 4c72f9a

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ format: #: Format and fix python code with black, isort, autoflake
7373
autoflake --remove-all-unused-imports --remove-unused-variables --remove-duplicate-keys --ignore-init-module-imports -i -r $(APP_DIR) $(TEST_DIR) $(HOME_DIR_PY_FILES)
7474

7575

76-
lint: #: Run static analysis with flake8, bandit and mypy
76+
lint: #: Run static analysis with flake8, mypy and bandit
7777
@echo "$(BOLD_CYAN)Flake linting ❄️$(RESET_STYLES)"
7878
flake8 --version
7979
flake8 $(APP_DIR) $(TEST_DIR) $(HOME_DIR_PY_FILES)
80+
@echo "$(BOLD_CYAN)Static typing️️$(RESET_STYLES)⌨️"
81+
mypy --version
82+
mypy $(APP_DIR) $(HOME_DIR_PY_FILES)
8083
@echo "$(BOLD_CYAN)Securing with bandit️🕵️️$(RESET_STYLES)"
8184
bandit --version
8285
bandit -l -i -r . --format=custom

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Tools
1111
------------------------------------------------------------------------------
1212
[![Min Python Version 3.6+](https://img.shields.io/badge/python-3.6+-3776AB.svg)](https://www.python.org/download/releases/3.6.0/)
1313
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
14-
[![PEP8](https://img.shields.io/badge/code%20style-pep8-orange.svg)](https://www.python.org/dev/peps/pep-0008/)
15-
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
14+
[![Static Analysis: flake8](https://img.shields.io/badge/static%20analysis-flake8-white.svg)](https://www.python.org/dev/peps/pep-0008/)
15+
[![Static Typing: mypy](https://img.shields.io/badge/static%20typing-mypy-blue.svg)](https://www.python.org/dev/peps/pep-0008/)
16+
[![Security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
1617

1718
Development Status
1819
------------------------------------------------------------------------------
@@ -40,4 +41,5 @@ Linting Guide
4041
------------------------------------------------------------------------------
4142
`make format` : Format and fix python code with black, isort, autoflake
4243

43-
`make lint` : Run static analysis with flake8, bandit and mypy
44+
`make lint` : Run static analysis with flake8, mypy and bandit
45+

documentation/linting.md

Whitespace-only changes.

src/core/singleton.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
from typing import Dict
2+
3+
14
class Singleton(type):
2-
_instances = {}
5+
_instances: Dict = {}
36

47
def __call__(cls, *args, **kwargs):
58
if cls not in cls._instances:

0 commit comments

Comments
 (0)