black: Reformat without skipping string normalization.
This commit is contained in:
parent
fba21bb00d
commit
6f3f9bf7e4
178 changed files with 5242 additions and 5242 deletions
|
@ -104,54 +104,54 @@ force_include = [
|
|||
|
||||
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")
|
||||
parser.add_argument(
|
||||
'targets',
|
||||
nargs='*',
|
||||
"targets",
|
||||
nargs="*",
|
||||
default=[],
|
||||
help="""files and directories to include in the result.
|
||||
If this is not specified, the current directory is used""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'-m', '--modified', action='store_true', default=False, help='list only modified files'
|
||||
"-m", "--modified", action="store_true", default=False, help="list only modified files"
|
||||
)
|
||||
parser.add_argument(
|
||||
'-a',
|
||||
'--all',
|
||||
dest='all',
|
||||
action='store_true',
|
||||
"-a",
|
||||
"--all",
|
||||
dest="all",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="""run mypy on all python files, ignoring the exclude list.
|
||||
This is useful if you have to find out which files fail mypy check.""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--no-disallow-untyped-defs',
|
||||
dest='disallow_untyped_defs',
|
||||
action='store_false',
|
||||
"--no-disallow-untyped-defs",
|
||||
dest="disallow_untyped_defs",
|
||||
action="store_false",
|
||||
default=True,
|
||||
help="""Don't throw errors when functions are not annotated""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--scripts-only',
|
||||
dest='scripts_only',
|
||||
action='store_true',
|
||||
"--scripts-only",
|
||||
dest="scripts_only",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="""Only type check extensionless python scripts""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--warn-unused-ignores',
|
||||
dest='warn_unused_ignores',
|
||||
action='store_true',
|
||||
"--warn-unused-ignores",
|
||||
dest="warn_unused_ignores",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="""Use the --warn-unused-ignores flag with mypy""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--no-ignore-missing-imports',
|
||||
dest='ignore_missing_imports',
|
||||
action='store_false',
|
||||
"--no-ignore-missing-imports",
|
||||
dest="ignore_missing_imports",
|
||||
action="store_false",
|
||||
default=True,
|
||||
help="""Don't use the --ignore-missing-imports flag with mypy""",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--quick', action='store_true', default=False, help="""Use the --quick flag with mypy"""
|
||||
"--quick", action="store_true", default=False, help="""Use the --quick flag with mypy"""
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -163,10 +163,10 @@ files_dict = cast(
|
|||
Dict[str, List[str]],
|
||||
lister.list_files(
|
||||
targets=args.targets,
|
||||
ftypes=['py', 'pyi'],
|
||||
ftypes=["py", "pyi"],
|
||||
use_shebang=True,
|
||||
modified_only=args.modified,
|
||||
exclude=exclude + ['stubs'],
|
||||
exclude=exclude + ["stubs"],
|
||||
group_by_ftype=True,
|
||||
extless_only=args.scripts_only,
|
||||
),
|
||||
|
@ -174,18 +174,18 @@ files_dict = cast(
|
|||
|
||||
for inpath in force_include:
|
||||
try:
|
||||
ext = os.path.splitext(inpath)[1].split('.')[1]
|
||||
ext = os.path.splitext(inpath)[1].split(".")[1]
|
||||
except IndexError:
|
||||
ext = 'py' # type: str
|
||||
ext = "py" # type: str
|
||||
files_dict[ext].append(inpath)
|
||||
|
||||
pyi_files = set(files_dict['pyi'])
|
||||
pyi_files = set(files_dict["pyi"])
|
||||
python_files = [
|
||||
fpath for fpath in files_dict['py'] if not fpath.endswith('.py') or fpath + 'i' not in pyi_files
|
||||
fpath for fpath in files_dict["py"] if not fpath.endswith(".py") or fpath + "i" not in pyi_files
|
||||
]
|
||||
|
||||
repo_python_files = OrderedDict(
|
||||
[('zulip', []), ('zulip_bots', []), ('zulip_botserver', []), ('tools', [])]
|
||||
[("zulip", []), ("zulip_bots", []), ("zulip_botserver", []), ("tools", [])]
|
||||
)
|
||||
for file_path in python_files:
|
||||
repo = PurePath(file_path).parts[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue