More agressive mypy

more_unit_tests
Thorsten Sick 3 years ago
parent ca6fb401fd
commit 1f75d6cfc6

@ -26,8 +26,8 @@ pylint:
# Testing if types are used properly # Testing if types are used properly
mypy: mypy:
mypy --strict-optional app/ mypy --strict-optional app/ plugins/base/
# Fixing mypy file by file # Fixing mypy file by file
stepbystep: stepbystep:
mypy --strict-optional plugins/base/plugin_base.py plugins/base/machinery.py app/config.py plugins/base/caldera.py plugins/base/attack.py plugins/base/sensor.py plugins/base/ssh_features.py plugins/base/vulnerability_plugin.py app/attack_log.py app/calderacontrol.py mypy --strict-optional --disallow-untyped-defs --check-untyped-defs plugins/base/ app/

@ -0,0 +1,13 @@
# My own Mypy configuration
# Global settings
[mypy]
warn_unused_configs = True
mypy_path = $MYPY_CONFIG_FILE_DIR:$MYPY_CONFIG_FILE_DIR/app:$MYPY_CONFIG_FILE_DIR/plugins/base
# Setting for the main app
[mypy-app.*]
# Setting for the plugins
[mypy-plugins.base.*]

@ -22,7 +22,7 @@ sphinx-revealjs
# sphinx-pydantic # This one has issues that must be fixed upstream first # sphinx-pydantic # This one has issues that must be fixed upstream first
# Mypy stuff # Mypy stuff
mypy==0.910 mypy==0.931
types-PyYAML==5.4.6 types-PyYAML==5.4.6
types-requests==2.25.6 types-requests==2.25.6
types-simplejson==3.17.0 types-simplejson==3.17.0

@ -36,6 +36,7 @@ deps = -r requirements.txt
bandit bandit
pylint pylint
argcomplete argcomplete
mypy
commands = commands =
@ -54,3 +55,5 @@ commands =
# Linting # Linting
# pylint *.py # currently off. Needs configuration # pylint *.py # currently off. Needs configuration
python3 ./plugin_manager.py check python3 ./plugin_manager.py check
# mypy checks
mypy --strict-optional app/ plugins/base/
Loading…
Cancel
Save