Skip to content

Commit

Permalink
Run mypy in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Jan 25, 2024
1 parent ccf9562 commit 44ed27f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
EDITORS = {'Windows': 'notepad'}


@xmod.xmod(mutable=True)
@xmod.xmod(mutable=True) # type: ignore[misc]
def editor(
text: t.Optional[str] = None,
filename: t.Union[None, Path, str] = None,
editor: t.Optional[str] = None,
**kwargs: t.Mapping,
**kwargs: t.Any,
) -> str:
"""
Open a text editor, block while the user edits, then return the results
Expand Down Expand Up @@ -115,6 +115,5 @@ def default_editor() -> str:
`'notepad'`, otherwise `'vim'`.
"""
return os.environ.get('VISUAL') or (
os.environ.get('EDITOR')
or EDITORS.get(platform.system(), DEFAULT_EDITOR)
os.environ.get('EDITOR') or EDITORS.get(platform.system(), DEFAULT_EDITOR)
)
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ line-length = 88

[tool.ruff.format]
quote-style = "single"

[tool.mypy]
strict = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion test_editor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
import unittest
from pathlib import Path
from unittest import mock

import tdir
Expand Down

0 comments on commit 44ed27f

Please sign in to comment.