Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ htmlcov/

# Package
*.egg-info

# No AI files
AGENTS.md
CLAUSE.md
GEMINI.md
.claude/
.cursor*
.codex/
.gemini/
31 changes: 29 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
Expand Down Expand Up @@ -53,6 +54,7 @@ subtle_gui = ["assets/*"]

[tool.ruff]
line-length = 120
preview = false

[tool.ruff.lint]
# Rules: https://docs.astral.sh/ruff/rules
Expand Down Expand Up @@ -99,7 +101,6 @@ ignore = [
"PLW0717", # too-many-statements-in-try-clause
"PLW2901", # redefined-loop-name
"RET505", # superfluous-else-return
"RUF001", # ambiguous-unicode-character-string
"RUF015", # unnecessary-iterable-allocation-for-first-element
"RUF067", # non-empty-init-module
"SIM108", # if-else-block-instead-of-if-exp
Expand All @@ -110,14 +111,40 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN", "D101", "D102", "D105", "PLC2701", "RUF069", "SLF", "TC"]

[tool.ruff.lint.pydocstyle]
ignore-decorators = [
"abc.abstractmethod",
"property",
"PyQt6.QtCore.pyqtProperty",
"typing.overload",
"pytest.fixture",
]

[tool.ruff.lint.isort]
lines-between-types = 1
forced-separate = ["tests"]
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.pylint]
max-nested-blocks = 10

[tool.ruff.format]
quote-style = "double"

[tool.pyright]
include = ["subtle"]
include = ["subtle_gui"]
reportIncompatibleMethodOverride = false
pythonVersion = "3.11"

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
testpaths = ["tests"]
log_level = "DEBUG"
qt_api = "pyqt6"

[tool.coverage.run]
branch = true
source = ["subtle_gui"]

[tool.coverage.report]
precision = 2
15 changes: 7 additions & 8 deletions subtle_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
# ============

# fmt: off
__package__ = "subtle_gui"
__copyright__ = "Copyright (C) Veronica Berglyd Olsen"
__license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen"
__package__ = "subtle_gui"
__copyright__ = "Copyright (C) Veronica Berglyd Olsen"
__license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
__version__ = "26.1.1"
__date__ = "2026-06-24"
__email__ = "code@vkbo.net"
__version__ = "26.1.1"
__date__ = "2026-06-24"
# fmt: on

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -173,7 +173,6 @@ def main(sysArgs: list | None = None) -> GuiMain | None:
app = QApplication([CONFIG.appName])
app.setApplicationName(CONFIG.appName)
app.setApplicationVersion(__version__)
app.setDesktopFileName(CONFIG.appName)

# Run Config steps that require the QApplication
CONFIG.load()
Expand Down
34 changes: 15 additions & 19 deletions subtle_gui/core/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,25 @@

RAW_SVG = {
"up": (
b'<path d="m20.247 17.565c1.0042-1.0029 1.0042-2.6332 0-3.6361l-8.2467-8.248-8.2467 8.248c'
b"-0.50272 0.50144-0.75344 1.1597-0.75344 1.818s0.25072 1.3166 0.75344 1.818c1.0042 1.0042"
b" 2.6319 1.0042 3.6361 0l4.6107-4.6094 4.6107 4.6094c1.0042 1.0042 2.6319 1.0042 3.6361 0"
b'z" fill="{foreground}" stroke-width="1.2857"/>'
b'<path d="m20.247 17.565c1.0042-1.0029 1.0042-2.6332 0-3.6361l-8.2467-8.248-8.2467 8.248c-0.50272 0.50144-0.75'
b"344 1.1597-0.75344 1.818s0.25072 1.3166 0.75344 1.818c1.0042 1.0042 2.6319 1.0042 3.6361 0l4.6107-4.6094 4.61"
b'07 4.6094c1.0042 1.0042 2.6319 1.0042 3.6361 0z" fill="{foreground}" stroke-width="1.2857"/>'
),
"down": (
b'<path d="m3.7531 6.4345c-1.0042 1.0029-1.0042 2.6332 0 3.6361l8.2467 8.248 8.2467-8.248c'
b"0.50272-0.50144 0.75344-1.1597 0.75344-1.818s-0.25072-1.3166-0.75344-1.818c-1.0042-1.004"
b"2-2.6319-1.0042-3.6361 0l-4.6107 4.6094-4.6107-4.6094c-1.0042-1.0042-2.6319-1.0042-3.636"
b'1 0z" fill="{foreground}" stroke-width="1.2857"/>'
b'<path d="m3.7531 6.4345c-1.0042 1.0029-1.0042 2.6332 0 3.6361l8.2467 8.248 8.2467-8.248c0.50272-0.50144 0.753'
b"44-1.1597 0.75344-1.818s-0.25072-1.3166-0.75344-1.818c-1.0042-1.0042-2.6319-1.0042-3.6361 0l-4.6107 4.6094-4."
b'6107-4.6094c-1.0042-1.0042-2.6319-1.0042-3.6361 0z" fill="{foreground}" stroke-width="1.2857"/>'
),
"italic": (b'<path d="m8.7248 21 3.5779-18h2.9724l-3.5779 18z" fill="{foreground}" stroke-width="2.0642"/>'),
"italic": b'<path d="m8.7248 21 3.5779-18h2.9724l-3.5779 18z" fill="{foreground}" stroke-width="2.0642"/>',
"note": (
b'<path d="m12.679 3q0.09536 0.5245 0.26225 0.95364 0.16689 0.4053 0.47682 0.8106 0.30993 '
b"0.4053 0.8106 0.88212 0.50066 0.45298 1.2636 1.0728 1.1921 0.97748 1.7881 1.9788 0.61987"
b" 0.97748 0.61987 2.1934 0 1.0728-0.45298 2.1934-0.42914 1.0967-1.0728 2.0026l-0.83444-0."
b"45298q0.50066-1.0728 0.50066-2.1934 0-0.97748-0.35762-1.5258-0.35762-0.57218-0.90596-1.0"
b"967-0.45298-0.42914-0.90596-0.78675-0.45298-0.35762-0.95364-0.76291v7.9629q0 2.1695-1.07"
b"28 3.4808-1.0728 1.2874-2.9801 1.2874-0.57219 0-1.0728-0.11921-0.50066-0.1192-0.88212-0."
b"38146-0.35762-0.26225-0.59603-0.64371-0.21457-0.4053-0.21457-0.95364 0-0.61987 0.28609-1"
b".1444 0.28609-0.5245 0.78676-0.90596 0.5245-0.4053 1.2397-0.61987 0.71523-0.23841 1.5735"
b'-0.23841 0.69139 0 1.2636 0.14305v-13.136z" fill="{foreground}" stroke-linecap="round" '
b'stroke-width="1.7881"/>'
b'<path d="m12.679 3q0.09536 0.5245 0.26225 0.95364 0.16689 0.4053 0.47682 0.8106 0.30993 0.4053 0.8106 0.88212'
b" 0.50066 0.45298 1.2636 1.0728 1.1921 0.97748 1.7881 1.9788 0.61987 0.97748 0.61987 2.1934 0 1.0728-0.45298 2"
b".1934-0.42914 1.0967-1.0728 2.0026l-0.83444-0.45298q0.50066-1.0728 0.50066-2.1934 0-0.97748-0.35762-1.5258-0."
b"35762-0.57218-0.90596-1.0967-0.45298-0.42914-0.90596-0.78675-0.45298-0.35762-0.95364-0.76291v7.9629q0 2.1695-"
b"1.0728 3.4808-1.0728 1.2874-2.9801 1.2874-0.57219 0-1.0728-0.11921-0.50066-0.1192-0.88212-0.38146-0.35762-0.2"
b"6225-0.59603-0.64371-0.21457-0.4053-0.21457-0.95364 0-0.61987 0.28609-1.1444 0.28609-0.5245 0.78676-0.90596 0"
b'.5245-0.4053 1.2397-0.61987 0.71523-0.23841 1.5735-0.23841 0.69139 0 1.2636 0.14305v-13.136z" fill="{foregrou'
b'nd}" stroke-linecap="round" stroke-width="1.7881"/>'
),
}

Expand Down
2 changes: 1 addition & 1 deletion subtle_gui/gui/highlighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

logger = logging.getLogger(__name__)

SPELL_RX = re.compile(r"\b[^\s\-–—\/<>]+\b", re.UNICODE)
SPELL_RX = re.compile(r"\b[^\s\-–—\/<>]+\b", re.UNICODE) # noqa: RUF001
IGNORE_PATTERNS = [
re.compile(r"[0-9][0-9,\.:]+[0-9]", re.UNICODE),
]
Expand Down
2 changes: 1 addition & 1 deletion subtle_gui/gui/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def _addWord(self, word: str, block: QTextBlock, save: bool) -> None:
wants to add a word to the user dictionary, or ignore it for the
current session.
"""
logger.debug("Added '%s' to session dictionary, saved = %s", word, str(save))
logger.debug("Added '%s' to session dictionary, saved = %s", word, save)
SHARED.spelling.addWord(word, save=save)
self.highlight.rehighlightBlock(block)

Expand Down
Loading