mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
Improved mypy checks
This commit is contained in:
parent
c0abda31bc
commit
a61a7916a3
2 changed files with 15 additions and 11 deletions
|
@ -25,6 +25,7 @@ __date__ = "$Date: 2010/10/01 $"
|
||||||
__revision__ = "$Date: 2016/08/26 $"
|
__revision__ = "$Date: 2016/08/26 $"
|
||||||
__license__ = "GPLv3"
|
__license__ = "GPLv3"
|
||||||
|
|
||||||
|
import typing
|
||||||
import operator
|
import operator
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
@ -37,7 +38,7 @@ def steganalyse(img):
|
||||||
"""
|
"""
|
||||||
encoded = img.copy()
|
encoded = img.copy()
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
colours_counter = Counter() # type: Counter[int]
|
colours_counter = Counter() # type: typing.Counter[int]
|
||||||
for row in range(height):
|
for row in range(height):
|
||||||
for col in range(width):
|
for col in range(width):
|
||||||
r, g, b = img.getpixel((col, row))
|
r, g, b = img.getpixel((col, row))
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
modules = ["stegano/tools.py",
|
modules = ['stegano/tools.py',
|
||||||
"stegano/lsb/lsb.py",
|
'stegano/lsb/lsb.py',
|
||||||
"stegano/lsbset/lsbset.py",
|
'stegano/lsbset/lsbset.py',
|
||||||
"stegano/lsbset/generators.py",
|
'stegano/lsbset/generators.py',
|
||||||
"stegano/red/red.py",
|
'stegano/red/red.py',
|
||||||
"stegano/exifHeader/exifHeader.py",
|
'stegano/exifHeader/exifHeader.py',
|
||||||
"stegano/steganalysis/parity.py",
|
'stegano/steganalysis/parity.py',
|
||||||
"stegano/steganalysis/statistics.py"]
|
'stegano/steganalysis/statistics.py']
|
||||||
|
|
||||||
exit_codes = []
|
exit_codes = []
|
||||||
for module in modules:
|
for module in modules:
|
||||||
rc = subprocess.call(["mypy", "--ignore-missing-imports",
|
rc = subprocess.call(['mypy', '--ignore-missing-imports',
|
||||||
"--follow-imports", "skip", module])
|
'--check-untyped-defs',
|
||||||
|
'--follow-imports', 'skip', module],
|
||||||
|
)
|
||||||
exit_codes.append(rc)
|
exit_codes.append(rc)
|
||||||
|
|
||||||
sys.exit(max(exit_codes))
|
sys.exit(max(exit_codes))
|
||||||
|
|
Loading…
Add table
Reference in a new issue