Skip to content

Commit

Permalink
fixup! Make init mypy-compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
carmenbianca committed Apr 9, 2023
1 parent 6a68058 commit 15e8f88
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/reuse/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"""Functions for REUSE-ifying a project."""

import sys
from argparse import ArgumentParser, Namespace
from gettext import gettext as _
from inspect import cleandoc
from pathlib import Path
from typing import List
from typing import IO, List
from urllib.error import URLError

from ._licenses import ALL_NON_DEPRECATED_MAP
Expand All @@ -18,7 +19,7 @@
from .vcs import find_root


def prompt_licenses(out=sys.stdout) -> List[str]:
def prompt_licenses(out: IO[str] = sys.stdout) -> List[str]:
"""Prompt the user for a list of licenses."""
first = _(
"What license is your project under? "
Expand Down Expand Up @@ -49,7 +50,7 @@ def prompt_licenses(out=sys.stdout) -> List[str]:
licenses.append(result)


def add_arguments(parser):
def add_arguments(parser: ArgumentParser) -> None:
"""Add arguments to parser."""
parser.add_argument(
"path",
Expand All @@ -59,7 +60,11 @@ def add_arguments(parser):
)


def run(args, project: Project, out=sys.stdout):
def run(
args: Namespace,
project: Project,
out: IO[str] = sys.stdout,
) -> int:
"""List all non-compliant files."""
# pylint: disable=too-many-statements,unused-argument
if args.path:
Expand Down

0 comments on commit 15e8f88

Please sign in to comment.