-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This file is part of Scapy | ||
# See http://www.secdev.org/projects/scapy for more information | ||
# Copyright (C) Philippe Biondi <[email protected]> | ||
# Copyright (C) Gabriel Potter <[email protected]> | ||
# This program is published under a GPLv2 license | ||
|
||
""" | ||
Performs Static typing checks over Scapy's codebase | ||
""" | ||
|
||
import io | ||
import os | ||
import sys | ||
|
||
from mypy.main import main as mypy_main | ||
|
||
# Load files | ||
|
||
with io.open("./.mypy/mypy_enabled.txt") as fd: | ||
FILES = [l.strip() for l in fd.readlines() if l.strip() and l[0] != "#"] | ||
|
||
if not FILES: | ||
print("No files specified. Arborting") | ||
sys.exit(0) | ||
|
||
# Generate Mypy arguments | ||
|
||
ARGS = ["--py2"] + [os.path.abspath(f) for f in FILES] | ||
|
||
# Run Mypy over the files | ||
|
||
mypy_main(None, sys.stdout, sys.stderr, ARGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file registers all files that have already been processed as part of | ||
# https://github.com/secdev/scapy/issues/2158, and therefore will be enforced | ||
# with unit tests in future development. | ||
|
||
# Style cheet: https://mypy.readthedocs.io/en/latest/cheat_sheet.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters