Pre-commit autoupdate

This commit is contained in:
Hugo Osvaldo Barrera 2024-01-31 19:08:01 +01:00
parent 7991419ab1
commit 42c5dba208
9 changed files with 22 additions and 10 deletions

View file

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
@ -9,11 +9,11 @@ repos:
- id: check-added-large-files
- id: debug-statements
- repo: https://github.com/psf/black
rev: "23.9.1"
rev: "24.1.1"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.5.1"
rev: "v1.8.0"
hooks:
- id: mypy
files: vdirsyncer/.*
@ -23,7 +23,7 @@ repos:
- types-requests
- types-atomicwrites
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.291'
rev: 'v0.1.15'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

View file

@ -4,6 +4,7 @@ Vdirsyncer synchronizes calendars and contacts.
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
how to package vdirsyncer.
"""
from __future__ import annotations
from setuptools import Command

View file

@ -1,6 +1,7 @@
"""
Test suite for vdirsyncer.
"""
from __future__ import annotations
import hypothesis.strategies as st

View file

@ -1,6 +1,7 @@
"""
General-purpose fixtures for vdirsyncer's testsuite.
"""
from __future__ import annotations
import logging

View file

@ -1,6 +1,7 @@
"""
Vdirsyncer synchronizes calendars and contacts.
"""
from __future__ import annotations
PROJECT_HOME = "https://github.com/pimutils/vdirsyncer"

View file

@ -2,6 +2,7 @@
Contains exception classes used by vdirsyncer. Not all exceptions are here,
only the most commonly used ones.
"""
from __future__ import annotations

View file

@ -34,7 +34,6 @@ class StorageMeta(ABCMeta):
class Storage(metaclass=StorageMeta):
"""Superclass of all storages, interface that all storages have to
implement.
@ -67,8 +66,8 @@ class Storage(metaclass=StorageMeta):
# The machine-readable name of this collection.
collection = None
#A value of False means storage does not support delete requests. A
#value of True mean the storage supports it.
# A value of False means storage does not support delete requests. A
# value of True mean the storage supports it.
no_delete = False
# A value of True means the storage does not support write-methods such as
@ -79,7 +78,13 @@ class Storage(metaclass=StorageMeta):
# The attribute values to show in the representation of the storage.
_repr_attributes: list[str] = []
def __init__(self, instance_name=None, read_only=None, no_delete=None, collection=None):
def __init__(
self,
instance_name=None,
read_only=None,
no_delete=None,
collection=None,
):
if read_only is None:
read_only = self.read_only
if self.read_only and not read_only:

View file

@ -9,6 +9,7 @@ Yang: http://blog.ezyang.com/2012/08/how-offlineimap-works/
Some modifications to it are explained in
https://unterwaditzer.net/2016/sync-algorithm.html
"""
from __future__ import annotations
import contextlib
@ -244,7 +245,9 @@ class Delete(Action):
async def _run_impl(self, a, b):
meta = self.dest.status.get_new(self.ident)
if self.dest.storage.read_only or self.dest.storage.no_delete:
sync_logger.debug(f"Skipping deletion of item {self.ident} from {self.dest.storage}")
sync_logger.debug(
f"Skipping deletion of item {self.ident} from {self.dest.storage}"
)
else:
sync_logger.info(f"Deleting item {self.ident} from {self.dest.storage}")
await self.dest.storage.delete(meta.href, meta.etag)

View file

@ -36,7 +36,6 @@ IGNORE_PROPS = (
class Item:
"""Immutable wrapper class for VCALENDAR (VEVENT, VTODO) and
VCARD"""