Skip to content

Commit

Permalink
Merge pull request #5457 from nabla-c0d3/mypy-no-implicit-optional
Browse files Browse the repository at this point in the history
Enable no_implicit_optional in mypy config
  • Loading branch information
zenmonkeykstop authored Aug 20, 2020
2 parents 193d352 + 6503d2d commit ef48794
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

0 comments on commit ef48794

Please sign in to comment.