Skip to content

Commit 2b4496f

Browse files
committed
Update linting tools
1 parent fc4a02c commit 2b4496f

File tree

11 files changed

+14
-20
lines changed

11 files changed

+14
-20
lines changed

Diff for: .pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: trailing-whitespace
66
args: [--markdown-linebreak-ext=md]
@@ -9,7 +9,7 @@ repos:
99
- id: check-added-large-files
1010
- id: debug-statements
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: "v1.8.0"
12+
rev: "v1.15.0"
1313
hooks:
1414
- id: mypy
1515
files: vdirsyncer/.*
@@ -18,7 +18,7 @@ repos:
1818
- types-docutils
1919
- types-requests
2020
- repo: https://github.com/charliermarsh/ruff-pre-commit
21-
rev: 'v0.2.2'
21+
rev: 'v0.11.4'
2222
hooks:
2323
- id: ruff
2424
args: [--fix, --exit-non-zero-on-fix]

Diff for: contrib/conflict_resolution/resolve_interactively.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
SPDX-FileCopyrightText: 2021 Intevation GmbH <https://intevation.de>
1717
Author: <bernhard.reiter@intevation.de>
1818
"""
19+
1920
from __future__ import annotations
2021

2122
import re

Diff for: docs/conf.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
html_theme = "default"
3838
if not on_rtd:
3939
print("-" * 74)
40-
print(
41-
"Warning: sphinx-rtd-theme not installed, building with default " "theme."
42-
)
40+
print("Warning: sphinx-rtd-theme not installed, building with default theme.")
4341
print("-" * 74)
4442

4543
html_static_path = ["_static"]

Diff for: tests/system/cli/test_sync.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ def test_empty_storage(tmpdir, runner):
9090
result = runner.invoke(["sync"])
9191
lines = result.output.splitlines()
9292
assert lines[0] == "Syncing my_pair"
93-
assert lines[1].startswith(
94-
"error: my_pair: " 'Storage "my_b" was completely emptied.'
95-
)
93+
assert lines[1].startswith('error: my_pair: Storage "my_b" was completely emptied.')
9694
assert result.exception
9795

9896

Diff for: tests/unit/utils/test_vobject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_hash_item():
154154

155155

156156
def test_multiline_uid(benchmark):
157-
a = "BEGIN:FOO\r\n" "UID:123456789abcd\r\n" " efgh\r\n" "END:FOO\r\n"
157+
a = "BEGIN:FOO\r\nUID:123456789abcd\r\n efgh\r\nEND:FOO\r\n"
158158
assert benchmark(lambda: vobject.Item(a).uid) == "123456789abcdefgh"
159159

160160

Diff for: vdirsyncer/cli/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def _resolve_conflict_via_command(
359359
new_b = f.read()
360360

361361
if new_a != new_b:
362-
raise exceptions.UserError("The two files are not completely " "equal.")
362+
raise exceptions.UserError("The two files are not completely equal.")
363363
return Item(new_a)
364364
finally:
365365
shutil.rmtree(dir)

Diff for: vdirsyncer/cli/discover.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ async def collections_for_pair(
7272
)
7373
else:
7474
raise exceptions.UserError(
75-
f"Please run `vdirsyncer discover {pair.name}` "
76-
" before synchronization."
75+
f"Please run `vdirsyncer discover {pair.name}` before synchronization."
7776
)
7877

7978
logger.info(f"Discovering collections for pair {pair.name}")

Diff for: vdirsyncer/repair.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ def repair_item(href, item, seen_uids, repair_unsafe_uid):
5656
new_item = item.with_uid(generate_href())
5757
elif not href_safe(item.uid) or not href_safe(basename(href)):
5858
if not repair_unsafe_uid:
59-
logger.warning(
60-
"UID may cause problems, add " "--repair-unsafe-uid to repair."
61-
)
59+
logger.warning("UID may cause problems, add --repair-unsafe-uid to repair.")
6260
else:
6361
logger.warning("UID or href is unsafe, assigning random UID.")
6462
new_item = item.with_uid(generate_href())

Diff for: vdirsyncer/storage/dav.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ async def _find_collections_impl(self, url):
261261

262262
href = response.find("{DAV:}href")
263263
if href is None:
264-
raise InvalidXMLResponse("Missing href tag for collection " "props.")
264+
raise InvalidXMLResponse("Missing href tag for collection props.")
265265
href = urlparse.urljoin(str(r.url), href.text)
266266
if href not in done:
267267
done.add(href)
@@ -792,7 +792,7 @@ def __init__(self, start_date=None, end_date=None, item_types=(), **kwargs):
792792
self.item_types = tuple(item_types)
793793
if (start_date is None) != (end_date is None):
794794
raise exceptions.UserError(
795-
"If start_date is given, " "end_date has to be given too."
795+
"If start_date is given, end_date has to be given too."
796796
)
797797
elif start_date is not None and end_date is not None:
798798
namespace = dict(datetime.__dict__)

Diff for: vdirsyncer/storage/singlefile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def create_collection(cls, collection, **kwargs):
9494
path = path % (collection,)
9595
except TypeError:
9696
raise ValueError(
97-
"Exactly one %s required in path " "if collection is not null."
97+
"Exactly one %s required in path if collection is not null."
9898
)
9999

100100
checkfile(path, create=True)

Diff for: vdirsyncer/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def open_graphical_browser(url, new=0, autoraise=True):
221221
if browser.open(url, new, autoraise):
222222
return
223223

224-
raise RuntimeError("No graphical browser found. Please open the URL " "manually.")
224+
raise RuntimeError("No graphical browser found. Please open the URL manually.")
225225

226226

227227
@contextlib.contextmanager

0 commit comments

Comments
 (0)