Skip to content

Commit f3e3ab7

Browse files
committed
Lint
1 parent 79e9bb6 commit f3e3ab7

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ dependencies = [
3333

3434
[tool.ruff]
3535
target-version = "py310"
36+
37+
[tool.ruff.lint]
3638
select = [
3739
# https://beta.ruff.rs/docs/rules/
3840
"F", # pyflakes
@@ -104,12 +106,11 @@ ignore = [
104106
"EM102", # f-string-in-exception -- no thanks
105107
"PLR0913", # too-many-arguments -- no thanks
106108
"D105", # undocumented-magic-method -- no thanks
107-
"ANN101", # missing-type-self -- unnecessary
108-
"ANN102", # missing-type-cls -- unnecessary
109109
"UP031", # use-format-specifiers -- no thanks
110+
"COM812", # -- conflict
110111
]
111112

112-
[tool.ruff.pydocstyle]
113+
[tool.ruff.lint.pydocstyle]
113114
convention = "google"
114115

115116
[dependency-groups]

src/gkeepapi/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ def __init__(self, auth: APIAuth | None = None) -> None:
426426
}
427427

428428
def create(
429-
self, node_id: str, node_server_id: str, dtime: datetime.datetime,
429+
self,
430+
node_id: str,
431+
node_server_id: str,
432+
dtime: datetime.datetime,
430433
) -> Any: # noqa: ANN401
431434
"""Create a new reminder.
432435
@@ -474,7 +477,10 @@ def create(
474477
return self.send(url=self._base_url + "create", method="POST", json=params)
475478

476479
def update_internal(
477-
self, node_id: str, node_server_id: str, dtime: datetime.datetime,
480+
self,
481+
node_id: str,
482+
node_server_id: str,
483+
dtime: datetime.datetime,
478484
) -> Any: # noqa: ANN401
479485
"""Update an existing reminder.
480486
@@ -903,7 +909,9 @@ def find(
903909
)
904910

905911
def createNote(
906-
self, title: str | None = None, text: str | None = None,
912+
self,
913+
title: str | None = None,
914+
text: str | None = None,
907915
) -> _node.Node:
908916
"""Create a new managed note. Any changes to the note will be uploaded when :py:meth:`sync` is called.
909917
@@ -970,7 +978,9 @@ def createLabel(self, name: str) -> _node.Label:
970978
return node
971979

972980
def findLabel(
973-
self, query: re.Pattern | str, create: bool = False,
981+
self,
982+
query: re.Pattern | str,
983+
create: bool = False,
974984
) -> _node.Label | None:
975985
"""Find a label with the given name.
976986

src/gkeepapi/node.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,9 @@ def _items(self, checked: bool | None = None) -> list[ListItem]:
18571857
]
18581858

18591859
def sort_items(
1860-
self, key: Callable = attrgetter("text"), reverse: bool = False,
1860+
self,
1861+
key: Callable = attrgetter("text"),
1862+
reverse: bool = False,
18611863
) -> None:
18621864
"""Sort list items in place. By default, the items are alphabetized, but a custom function can be specified.
18631865
@@ -2135,14 +2137,16 @@ def _load(self, raw: dict) -> None:
21352137
self.drawing_id = raw["drawingId"]
21362138
self.snapshot.load(raw["snapshotData"])
21372139
self._snapshot_fingerprint = raw.get(
2138-
"snapshotFingerprint", self._snapshot_fingerprint,
2140+
"snapshotFingerprint",
2141+
self._snapshot_fingerprint,
21392142
)
21402143
self._thumbnail_generated_time = NodeTimestamps.str_to_dt(
21412144
raw.get("thumbnailGeneratedTime"),
21422145
)
21432146
self._ink_hash = raw.get("inkHash", "")
21442147
self._snapshot_proto_fprint = raw.get(
2145-
"snapshotProtoFprint", self._snapshot_proto_fprint,
2148+
"snapshotProtoFprint",
2149+
self._snapshot_proto_fprint,
21462150
)
21472151

21482152
def save(self, clean: bool = True) -> dict: # noqa: D102

0 commit comments

Comments
 (0)