Update pre-commit
This commit is contained in:
@@ -12,12 +12,12 @@ repos:
|
||||
exclude: ".*(galleria|photoswipe|jquery|leaflet).*$"
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.3.0
|
||||
rev: 23.9.1
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.0.270
|
||||
rev: v0.0.291
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]
|
||||
|
||||
@@ -418,9 +418,7 @@ class Album:
|
||||
signals.album_initialized.send(self)
|
||||
|
||||
def __repr__(self):
|
||||
return "<{}>(path={!r}, title={!r})".format(
|
||||
self.__class__.__name__, self.path, self.title
|
||||
)
|
||||
return f"<{self.__class__.__name__}>(path={self.path!r}, title={self.title!r})"
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.path} : " + ", ".join(
|
||||
|
||||
@@ -73,9 +73,7 @@ def generate_feed(gallery, medias, feed_type=None, feed_url="", nb_items=0):
|
||||
# unique_id='tag:%s,%s:%s' % (urlparse(link).netloc,
|
||||
# item.date.date(),
|
||||
# urlparse(link).path.lstrip('/')),
|
||||
description='<img src="{}/{}/{}" />'.format(
|
||||
base_url, item.path, item.thumbnail
|
||||
),
|
||||
description=f'<img src="{base_url}/{item.path}/{item.thumbnail}" />',
|
||||
# categories=item.tags if hasattr(item, 'tags') else None,
|
||||
author_name=getattr(item, "author", ""),
|
||||
pubdate=item.date or datetime.now(),
|
||||
|
||||
@@ -36,9 +36,7 @@ def walk_destination(destination, suffixes, compress_suffix):
|
||||
for path, dirs, files in os.walk(destination):
|
||||
for file in files:
|
||||
original_filename = os.path.join(path, file)
|
||||
compressed_filename = "{}.{}".format(
|
||||
os.path.join(path, file), compress_suffix
|
||||
)
|
||||
compressed_filename = f"{os.path.join(path, file)}.{compress_suffix}"
|
||||
path_exists = os.path.exists(compressed_filename)
|
||||
file_ext = os.path.splitext(file)[1][1:]
|
||||
if file_ext in suffixes:
|
||||
|
||||
Reference in New Issue
Block a user