mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-06-17 12:56:36 +00:00
chore: bump ruff to 0.15.17
This commit is contained in:
@@ -54,7 +54,7 @@ pytest = [
|
||||
"pytest-qt==4.4.0",
|
||||
"syrupy==5.1.0",
|
||||
]
|
||||
ruff = ["ruff==0.11.8"]
|
||||
ruff = ["ruff==0.15.17"]
|
||||
|
||||
[project.gui-scripts]
|
||||
tagstudio = "tagstudio.main:main"
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
import enum
|
||||
|
||||
|
||||
class SettingItems(str, enum.Enum):
|
||||
class SettingItems(enum.StrEnum):
|
||||
"""List of setting item names."""
|
||||
|
||||
LAST_LIBRARY = "last_library"
|
||||
LIBS_LIST = "libs_list"
|
||||
|
||||
|
||||
class ShowFilepathOption(int, enum.Enum):
|
||||
class ShowFilepathOption(enum.IntEnum):
|
||||
"""Values representing the options for the "show_filenames" setting."""
|
||||
|
||||
SHOW_FULL_PATHS = 0
|
||||
@@ -21,7 +21,7 @@ class ShowFilepathOption(int, enum.Enum):
|
||||
DEFAULT = SHOW_RELATIVE_PATHS
|
||||
|
||||
|
||||
class TagClickActionOption(int, enum.Enum):
|
||||
class TagClickActionOption(enum.IntEnum):
|
||||
"""Values representing the options for the "tag_click_action" setting."""
|
||||
|
||||
OPEN_EDIT = 0
|
||||
@@ -30,7 +30,7 @@ class TagClickActionOption(int, enum.Enum):
|
||||
DEFAULT = OPEN_EDIT
|
||||
|
||||
|
||||
class Theme(str, enum.Enum):
|
||||
class Theme(enum.StrEnum):
|
||||
COLOR_BG_DARK = "#65000000"
|
||||
COLOR_BG_LIGHT = "#22000000"
|
||||
COLOR_DARK_LABEL = "#DD000000"
|
||||
@@ -49,7 +49,7 @@ class OpenStatus(enum.IntEnum):
|
||||
CORRUPTED = 2
|
||||
|
||||
|
||||
class MacroID(enum.Enum):
|
||||
class MacroID(enum.StrEnum):
|
||||
AUTOFILL = "autofill"
|
||||
SIDECAR = "sidecar"
|
||||
BUILD_URL = "build_url"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
|
||||
import enum
|
||||
import mimetypes
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
|
||||
import structlog
|
||||
@@ -23,7 +23,7 @@ FILETYPE_EQUIVALENTS = [
|
||||
]
|
||||
|
||||
|
||||
class MediaType(str, Enum):
|
||||
class MediaType(enum.StrEnum):
|
||||
"""Names of media types."""
|
||||
|
||||
ADOBE_PHOTOSHOP = "adobe_photoshop"
|
||||
|
||||
@@ -24,7 +24,7 @@ class ConstraintType(Enum):
|
||||
"filetype": ConstraintType.FileType,
|
||||
"path": ConstraintType.Path,
|
||||
"special": ConstraintType.Special,
|
||||
}.get(text.lower(), None)
|
||||
}.get(text.lower())
|
||||
|
||||
|
||||
class AST:
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
|
||||
from typing import TypeVar
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
def unwrap(optional: T | None, default: T | None = None) -> T:
|
||||
def unwrap[T](optional: T | None, default: T | None = None) -> T:
|
||||
if optional is not None:
|
||||
return optional
|
||||
if default is not None:
|
||||
|
||||
@@ -447,7 +447,7 @@ class FieldContainers(QWidget):
|
||||
inner_widget.set_tags(tags)
|
||||
|
||||
inner_widget.on_update.connect(
|
||||
lambda: (self.update_from_entry(self.cached_entries[0].id, update_badges=True))
|
||||
lambda: self.update_from_entry(self.cached_entries[0].id, update_badges=True)
|
||||
)
|
||||
else:
|
||||
text = "<i>Mixed Data</i>"
|
||||
|
||||
@@ -366,8 +366,8 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.tag_manager_panel = PanelModal(
|
||||
widget=TagDatabasePanel(self, self.lib),
|
||||
title=Translations["tag_manager.title"],
|
||||
done_callback=lambda checked=False: (
|
||||
self.main_window.preview_panel.set_selection(self.selected, update_preview=False)
|
||||
done_callback=lambda checked=False: self.main_window.preview_panel.set_selection(
|
||||
self.selected, update_preview=False
|
||||
),
|
||||
has_save=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user