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

chore(dependencies): update precommit hook asottile/pyupgrade to v2.21.1 #23

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/pyupgrade
rev: v2.21.0
rev: v2.21.1
hooks:
- id: pyupgrade
args: ['--py36-plus']
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ mypy . # mypy should report 0 errors now.

### v0.1.0

- Initial release
- Initial release
2 changes: 1 addition & 1 deletion mypy_silent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def mypy_silent(
for info in infos:
if info.position in processed:
continue
with open(info.position.filename, "r") as f:
with open(info.position.filename) as f:
file_contents = f.readlines()

old_content = file_contents[info.position.line - 1]
Expand Down
7 changes: 5 additions & 2 deletions mypy_silent/parser.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import re
from typing import FrozenSet
from typing import Iterable
from typing import NamedTuple
from typing import FrozenSet

from typing_extensions import Final

UNUSED_IGNORE_MESSAGES: Final[FrozenSet[str]] = frozenset({"error: unused 'type: ignore' comment", 'error: unused "type: ignore" comment'})
UNUSED_IGNORE_MESSAGES: Final[FrozenSet[str]] = frozenset(
{"error: unused 'type: ignore' comment", 'error: unused "type: ignore" comment'}
)


class FilePosition(NamedTuple):
Expand Down
2 changes: 1 addition & 1 deletion mypy_silent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
def get_lines(mypy_output_file: Optional[str]) -> Iterable[str]:
if not mypy_output_file:
return sys.stdin
with open(mypy_output_file, "r") as f:
with open(mypy_output_file) as f:
return f.readlines()