Skip to content

Commit cf0f69a

Browse files
committed
Apply automatic linting fixes
1 parent 582d618 commit cf0f69a

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

cookie_python/manage/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
from enum import Enum
66
from pathlib import Path
7-
from typing import Callable, Optional
7+
from typing import Callable
88

99
from loguru import logger
1010

@@ -28,7 +28,7 @@ class Action(str, Enum):
2828
def __new__(
2929
cls,
3030
value: str,
31-
func: Optional[Callable[[argparse.Namespace], None]] = None,
31+
func: Callable[[argparse.Namespace], None] | None = None,
3232
description: str = "",
3333
) -> Action:
3434
obj = str.__new__(cls, value)

cookie_python/manage/repo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from functools import cached_property
1010
from pathlib import Path
1111
from types import TracebackType
12-
from typing import Any, Optional
12+
from typing import Any
1313

1414
import loguru
1515

@@ -30,9 +30,9 @@ def __enter__(self) -> RepoSandbox:
3030

3131
def __exit__(
3232
self,
33-
exc_type: Optional[type[BaseException]] = None,
34-
exc_val: Optional[BaseException] = None,
35-
exc_tb: Optional[TracebackType] = None,
33+
exc_type: type[BaseException] | None = None,
34+
exc_val: BaseException | None = None,
35+
exc_tb: TracebackType | None = None,
3636
) -> None:
3737
self._stack.close()
3838

@@ -58,7 +58,7 @@ def create_release(self, tag: str) -> None:
5858
)
5959

6060
@cached_property
61-
def logger(self) -> "loguru.Logger":
61+
def logger(self) -> loguru.Logger:
6262
return loguru.logger.bind(repo=self.repo.full_name)
6363

6464
@cached_property

tests/test_template.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def test_project_license(cookies: Any, project_license: str) -> None:
6868
if project_license in ("MIT", "BSD-3-Clause"):
6969
# Compare copyright line separately
7070
if project_license == "MIT":
71-
expected_copyright = "Copyright (c) {0} Ness".format(
71+
expected_copyright = "Copyright (c) {} Ness".format(
7272
datetime.date.today().year
7373
)
7474
elif project_license == "BSD-3-Clause":
75-
expected_copyright = "Copyright (c) {0}, Ness".format(
75+
expected_copyright = "Copyright (c) {}, Ness".format(
7676
datetime.date.today().year
7777
)
7878
assert license_data.splitlines()[0] == expected_copyright
@@ -171,11 +171,11 @@ def test_rendered_readme(
171171
),
172172
)
173173

174-
with open(os.path.join(result.project_path, "README.md"), "r") as f:
174+
with open(os.path.join(result.project_path, "README.md")) as f:
175175
readme = f.read()
176176
if opt_update_expected_outputs:
177177
with open(expected_content_file, "w") as f:
178178
f.write(readme)
179179

180-
with open(expected_content_file, "r") as f:
180+
with open(expected_content_file) as f:
181181
assert readme == f.read()

0 commit comments

Comments
 (0)