Skip to content

Commit

Permalink
Merge pull request #2190 from glensc/ruff-format-update
Browse files Browse the repository at this point in the history
Linter: Update pre-commit hooks (ruff-pre-commit v0.9.7)
  • Loading branch information
glensc authored Feb 21, 2025
2 parents 1bb5a52 + 7e6dc62 commit b89e9c3
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: destroyed-symlinks

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.9.7
hooks:
- id: ruff
args: [ --fix ]
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
The '__main__' module does not seem to have been run in the context of a
runnable package ... did you forget to add the '-m' flag?
Usage: {sys.executable} -m plextraktsync {' '.join(sys.argv[1:])}
Usage: {sys.executable} -m plextraktsync {" ".join(sys.argv[1:])}
"""
)
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/plex/PlexId.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ def __repr__(self):
keys = [self.__class__.__name__, self.server, self.provider, self.key]
fields = map(str, filter(None, keys))

return f'<{":".join(fields)}>'
return f"<{':'.join(fields)}>"
3 changes: 1 addition & 2 deletions plextraktsync/plex/PlexPlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def playlist(self) -> Playlist | None:
playlist: Playlist = playlists[0]
if len(playlists) > 1:
self.logger.warning(
f"Found multiple playlists ({len(playlists)}) with same name: '{self.name}', "
f"Using first playlist with id {playlist.ratingKey}"
f"Found multiple playlists ({len(playlists)}) with same name: '{self.name}', Using first playlist with id {playlist.ratingKey}"
)
self.logger.debug(f"Loaded plex list: '{self.name}'")
return playlist
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/rich/RichProgressBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def progress(self):
from tqdm.rich import FractionColumn, RateColumn

args = (
"[progress.description]{task.description}" "[progress.percentage]{task.percentage:>4.0f}%",
"[progress.description]{task.description}[progress.percentage]{task.percentage:>4.0f}%",
BarColumn(bar_width=None),
FractionColumn(
unit_scale=False,
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/sync/LikedListsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def factory(cls, sync: Sync):
@hookimpl
def init(self, sync: Sync, is_partial: bool, dry_run: bool):
if is_partial or dry_run:
self.logger.warning("Partial walk, disabling liked lists updating. " "Liked lists won't update because it needs full library sync.")
self.logger.warning("Partial walk, disabling liked lists updating. Liked lists won't update because it needs full library sync.")
if is_partial:
return

Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/sync/WatchListPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def init(self, sync: Sync, is_partial: bool):
return

if is_partial:
self.logger.warning("Running partial library sync. " "Watchlist as playlist won't update because it needs full library sync.")
self.logger.warning("Running partial library sync. Watchlist as playlist won't update because it needs full library sync.")
else:
sync.trakt_lists.add_watchlist(self.trakt.watchlist_movies)

Expand All @@ -51,7 +51,7 @@ async def fini(self, walker: Walker, dry_run: bool):
await self.sync_watchlist(walker, dry_run=dry_run)

if self.config.update_plex_wl_as_pl and dry_run:
self.logger.warning("Running partial library sync. " "Liked lists won't update because it needs full library sync.")
self.logger.warning("Running partial library sync. Liked lists won't update because it needs full library sync.")

@cached_property
def plex_wl(self):
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/trakt/TraktLookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from plextraktsync.decorators.retry import retry
from plextraktsync.factory import logging

EPISODES_ORDERING_WARNING = "episodes ordering is different in Plex and Trakt. " "Check your Plex media source, TMDB is recommended."
EPISODES_ORDERING_WARNING = "episodes ordering is different in Plex and Trakt. Check your Plex media source, TMDB is recommended."

if TYPE_CHECKING:
from trakt.tv import TVEpisode, TVShow
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/util/Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def full_version(self):
# Print version from pip
if self.pipx_installed:
v = self.vcs_info
return f'{__version__[0:-4]}@pr/{v["pr"]}#{v["short_commit_id"]}'
return f"{__version__[0:-4]}@pr/{v['pr']}#{v['short_commit_id']}"

# If installed with Git
gv = self.git_version_info
Expand Down

0 comments on commit b89e9c3

Please sign in to comment.