add pre-commit config (#6341)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Jelle Zijlstra
2021-11-19 06:46:51 -08:00
committed by GitHub
parent 1fcb613338
commit 1f1bc6f27c
9 changed files with 52 additions and 68 deletions

View File

@@ -198,18 +198,18 @@ def run_mypy(args, configurations, major, minor, files, *, custom_typeshed=False
def get_mypy_flags(args, major: int, minor: int, temp_name: str, *, custom_typeshed: bool) -> list[str]:
flags = [
"--python-version",
"%d.%d" % (major, minor),
"--config-file",
temp_name,
"--no-site-packages",
"--show-traceback",
"--no-implicit-optional",
"--disallow-any-generics",
"--warn-incomplete-stub",
"--show-error-codes",
"--no-error-summary",
]
"--python-version",
"%d.%d" % (major, minor),
"--config-file",
temp_name,
"--no-site-packages",
"--show-traceback",
"--no-implicit-optional",
"--disallow-any-generics",
"--warn-incomplete-stub",
"--show-error-codes",
"--no-error-summary",
]
if custom_typeshed:
# Setting custom typeshed dir prevents mypy from falling back to its bundled
# typeshed in case of stub deletions
@@ -235,12 +235,7 @@ def read_dependencies(distribution: str) -> list[str]:
def add_third_party_files(
distribution: str,
major: int,
files: list[str],
args,
configurations: list[MypyDistConf],
seen_dists: set[str],
distribution: str, major: int, files: list[str], args, configurations: list[MypyDistConf], seen_dists: set[str]
) -> None:
if distribution in seen_dists:
return
@@ -264,9 +259,7 @@ def add_third_party_files(
add_configuration(configurations, distribution)
def test_third_party_distribution(
distribution: str, major: int, minor: int, args
) -> tuple[int, int]:
def test_third_party_distribution(distribution: str, major: int, minor: int, args) -> tuple[int, int]:
"""Test the stubs of a third-party distribution.
Return a tuple, where the first element indicates mypy's return code