Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

python: Elide type=str from argparse arguments.

Alex Vandiver1e943ae7df71
diff --git a/tools/screenshots/generate-user-messages-screenshot b/tools/screenshots/generate-user-messages-screenshot
index dd769e4f5d4..4172559837f 100755
--- a/tools/screenshots/generate-user-messages-screenshot
+++ b/tools/screenshots/generate-user-messages-screenshot
@@ -246,7 +246,6 @@ group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
"--thread",
nargs="+",
- type=str,
help="Path of the file where the thread for screenshot is present",
)
fixture_group = parser.add_argument_group("thread")
diff --git a/zerver/management/commands/change_auth_backends.py b/zerver/management/commands/change_auth_backends.py
index 2fca0c8d6f6..cbaee6d2303 100644
--- a/zerver/management/commands/change_auth_backends.py
+++ b/zerver/management/commands/change_auth_backends.py
@@ -17,12 +17,10 @@ class Command(ZulipBaseCommand):
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
"--enable",
- type=str,
help="Name of the authentication backend to enable",
)
group.add_argument(
"--disable",
- type=str,
help="Name of the authentication backend to disable",
)
group.add_argument(
diff --git a/zerver/management/commands/email_server.py b/zerver/management/commands/email_server.py
index ede361bb0eb..5f0b6f7cde0 100644
--- a/zerver/management/commands/email_server.py
+++ b/zerver/management/commands/email_server.py
@@ -20,13 +20,11 @@ class Command(BaseCommand):
parser.add_argument(
"--user",
help="User to drop privileges to, if started as root.",
- type=str,
required=(os.geteuid() == 0),
)
parser.add_argument(
"--group",
help="Group to drop privileges to, if started as root.",
- type=str,
required=(os.geteuid() == 0),
)
tls_cert: str | None = None
@@ -44,13 +42,11 @@ class Command(BaseCommand):
parser.add_argument(
"--tls-cert",
help="Path to TLS certificate chain file",
- type=str,
default=tls_cert,
)
parser.add_argument(
"--tls-key",
help="Path to TLS private key file",
- type=str,
default=tls_key,
)
diff --git a/zerver/management/commands/runtusd.py b/zerver/management/commands/runtusd.py
index fe9dae912a4..8dd525ef682 100644
--- a/zerver/management/commands/runtusd.py
+++ b/zerver/management/commands/runtusd.py
@@ -14,9 +14,7 @@ class Command(BaseCommand):
@override
def add_arguments(self, parser: CommandParser) -> None:
- parser.add_argument(
- "listen", help="[Port, or address:port, to bind HTTP server to]", type=str
- )
+ parser.add_argument("listen", help="[Port, or address:port, to bind HTTP server to]")
local_port = 80
config_file = get_config_file()
if get_config(config_file, "application_server", "http_only", False):
diff --git a/zilencer/management/commands/manage_push_registration_encryption_keys.py b/zilencer/management/commands/manage_push_registration_encryption_keys.py
index d11e07d24d1..034d7d1d481 100644
--- a/zilencer/management/commands/manage_push_registration_encryption_keys.py
+++ b/zilencer/management/commands/manage_push_registration_encryption_keys.py
@@ -29,7 +29,6 @@ Usage:
)
parser.add_argument(
"--remove-key",
- type=str,
metavar="PUBLIC_KEY",
help="Remove the key pair associated with the given public key from the `push_registration_encryption_keys` map.",
)