Skip to content

Commit 93f15d4

Browse files
committed
run pre-commit and enable GitHub integration
1 parent 7eb5b04 commit 93f15d4

File tree

11 files changed

+38
-19
lines changed

11 files changed

+38
-19
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ repos:
4040
additional_dependencies: []
4141
exclude: src/scantailor/translations/
4242
- repo: https://github.com/astral-sh/ruff-pre-commit
43-
rev: "v0.1.11"
43+
rev: "v0.2.1"
4444
hooks:
4545
- id: ruff
4646
args: [--fix, --exit-non-zero-on-fix]

.yamllint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
key-duplicates: enable
6+
line-length:
7+
max: 270
8+
allow-non-breakable-words: true
9+
allow-non-breakable-inline-mappings: true
10+
truthy: disable

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Goal:
1212
Much bigger task than I originally thought.
1313
- [ ] The translations won't work as they are also covering the stuff in the .cpp files.
1414
- [x] Should take inspiration from: https://github.com/JackLilhammers/pyside6-boilerplate/tree/main -- Made my own fork and used it as a grounds to get familiar and upgrade to more modern Python: https://github.com/adehad/pyside6-boilerplate
15-
- [x] Using the pdm post_install hook to run the ui class generaion would be ideal. -- we can use the loader class, for the translations, we can generate however
15+
- [x] Using the pdm post_install hook to run the ui class generation would be ideal. -- we can use the loader class, for the translations, we can generate however
1616
- [ ] generate the translations via the devcontainer, this worked fine in the template, but we can do it a bit differently here
1717
- [ ] The translations should also become a Qt resource, with proper prefixins as shown here: https://www.pythonguis.com/tutorials/packaging-data-files-pyside6-with-qresource-system/
1818
- [x] Run app via debugger -- I mean it didn't do anything and there are things to sort, out but it is a start

pyproject.toml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ exclude = '''(?x)(
8080
)'''
8181

8282
[tool.ruff]
83+
# The source code paths to consider, e.g., when resolving first- vs. third-party imports
84+
src = ["scantailor", "tests"]
85+
extend-exclude = ["./src/scantailor/_ui/*_ui.py"]
86+
87+
# Assume Python 3.12. (minimum supported)
88+
target-version = "py312"
89+
90+
# Same as Black.
91+
line-length = 88
92+
93+
[tool.ruff.lint]
8394
select = [
8495
"E", # pydocstyle
8596
"W", # pydocstyle
@@ -90,24 +101,14 @@ select = [
90101
"RUF", # ruff
91102
]
92103
ignore = []
93-
extend-exclude = ["./src/scantailor/_ui/*_ui.py"]
94-
95-
# Same as Black.
96-
line-length = 88
97104

98105
# Allow unused variables when underscore-prefixed.
99106
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
100107

101-
# Assume Python 3.12. (minimum supported)
102-
target-version = "py312"
103-
104-
# The source code paths to consider, e.g., when resolving first- vs. third-party imports
105-
src = ["scantailor", "tests"]
106-
107-
[tool.ruff.isort]
108+
[tool.ruff.lint.isort]
108109
known-first-party = ["scantailor", "tests"]
109110
required-imports = ["from __future__ import annotations"]
110111

111-
[tool.ruff.pydocstyle]
112+
[tool.ruff.lint.pydocstyle]
112113
# Use Google-style docstrings.
113114
convention = "google"

src/scantailor/__about__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Project Metadata."""
2+
from __future__ import annotations
3+
24
try:
35
import importlib.metadata
46

src/scantailor/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""ScanTailor."""
2+
from __future__ import annotations
3+
24
from .__about__ import __version__
35

46
__all__ = [

src/scantailor/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
No relative imports so PyInstaller doesn't get confused.
44
"""
5+
from __future__ import annotations
56

67
from scantailor.main import main
78

src/scantailor/app/ui/DefaultParamsDialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,7 @@ QToolButton:pressed {
31743174
<item>
31753175
<widget class="QCheckBox" name="higherSearchSensitivityCB">
31763176
<property name="text">
3177-
<string>Higher search sensivity</string>
3177+
<string>Higher search sensitivity</string>
31783178
</property>
31793179
</widget>
31803180
</item>

src/scantailor/app/ui/SettingsDialog.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
<item row="1" column="1">
358358
<widget class="QDoubleSpinBox" name="selectContentDeviationCoefSB">
359359
<property name="toolTip">
360-
<string>Deviation multiplier: a higher value means lower sensivity.</string>
360+
<string>Deviation multiplier: a higher value means lower sensitivity.</string>
361361
</property>
362362
<property name="minimum">
363363
<double>0.100000000000000</double>
@@ -380,7 +380,7 @@
380380
<item row="0" column="1">
381381
<widget class="QDoubleSpinBox" name="deskewDeviationCoefSB">
382382
<property name="toolTip">
383-
<string>Deviation multiplier: a higher value means lower sensivity.</string>
383+
<string>Deviation multiplier: a higher value means lower sensitivity.</string>
384384
</property>
385385
<property name="minimum">
386386
<double>0.100000000000000</double>
@@ -428,7 +428,7 @@
428428
<item row="2" column="1">
429429
<widget class="QDoubleSpinBox" name="marginsDeviationCoefSB">
430430
<property name="toolTip">
431-
<string>Deviation multiplier: a higher value means lower sensivity.</string>
431+
<string>Deviation multiplier: a higher value means lower sensitivity.</string>
432432
</property>
433433
<property name="minimum">
434434
<double>0.100000000000000</double>

src/scantailor/app/ui/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""UI Elements & Screens."""
2+
from __future__ import annotations
3+
24
import pathlib
35

46
from PySide6 import QtCore, QtUiTools, QtWidgets
@@ -10,7 +12,7 @@ def load_ui_widget(ui_filename: pathlib.Path, parent=None) -> QtWidgets.QWidget:
1012
"""Load UI Widget."""
1113
loader = QtUiTools.QUiLoader()
1214
ui_file = QtCore.QFile(str(ui_filename))
13-
ui_file.open(QtCore.QFile.ReadOnly) # type: ignore[attr-defined]
15+
ui_file.open(QtCore.QFile.ReadOnly) # type: ignore[attr-defined]
1416
ui = loader.load(ui_file, parent)
1517
ui_file.close()
1618
return ui

src/scantailor/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Main Entrypoint for the application."""
2+
from __future__ import annotations
23

34
from PySide6 import QtWidgets
45

0 commit comments

Comments
 (0)