Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable no_implicit_optional in mypy config #5457

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[mypy]
ignore_missing_imports = True
no_implicit_optional = True
python_version = 3.5

[mypy-config]
Expand Down
4 changes: 2 additions & 2 deletions securedrop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class Source(db.Model):
MAX_CODENAME_LEN = 128

def __init__(self,
filesystem_id: str = None,
journalist_designation: str = None) -> None:
filesystem_id: 'Optional[str]' = None,
journalist_designation: 'Optional[str]' = None) -> None:
self.filesystem_id = filesystem_id
self.journalist_designation = journalist_designation
self.uuid = str(uuid.uuid4())
Expand Down
4 changes: 2 additions & 2 deletions securedrop/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sdconfig import config


def create_queue(name: str = None, timeout: int = 3600) -> Queue:
def create_queue(name: Optional[str] = None, timeout: int = 3600) -> Queue:
"""
Create an rq ``Queue`` named ``name`` with default timeout ``timeout``.

Expand Down Expand Up @@ -52,7 +52,7 @@ def worker_for_job(job_id: str) -> Optional[Worker]:
return None


def requeue_interrupted_jobs(queue_name: str = None) -> None:
def requeue_interrupted_jobs(queue_name: Optional[str] = None) -> None:
"""
Requeues jobs found in the given queue's started job registry.

Expand Down