From a80c2543c93c5a26c12b734a9bab1a1bfeb96672 Mon Sep 17 00:00:00 2001 From: F2011 Date: Wed, 11 Mar 2026 20:56:41 +0100 Subject: [PATCH 1/5] Format --- .github/workflows/ci.yml | 96 ++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddf3a8c..595b8f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [ push, pull_request ] +on: [push, pull_request] permissions: contents: read @@ -13,53 +13,53 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] env: - DISPLAY: ':99.0' - steps: - - uses: actions/checkout@v4 - - name: Install system packages - run: | - sudo apt update - sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 libgtk-3-0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - name: Print Python version - run: python -c "import sys; print(sys.version)" - - name: Install pip - run: | - python -m pip install --upgrade pip - - name: Install typstwriter - run: | - pip install . - pip install .[tests] - - name: Start X - run: | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX - - name: Create trash directory - run: | - sudo mkdir -m 777 /tmp_pytest - - name: Run tests - run: | - pytest - env: - PYTEST_DEBUG_TEMPROOT: /tmp_pytest - + DISPLAY: ":99.0" + steps: + - uses: actions/checkout@v4 + - name: Install system packages + run: | + sudo apt update + sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 libgtk-3-0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + - name: Print Python version + run: python -c "import sys; print(sys.version)" + - name: Install pip + run: | + python -m pip install --upgrade pip + - name: Install typstwriter + run: | + pip install . + pip install .[tests] + - name: Start X + run: | + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX + - name: Create trash directory + run: | + sudo mkdir -m 777 /tmp_pytest + - name: Run tests + run: | + pytest + env: + PYTEST_DEBUG_TEMPROOT: /tmp_pytest + ruff: name: Ruff runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Install pip and ruff - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff - run: | - ruff check --output-format=github - ruff format --check + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install pip and ruff + run: | + python -m pip install --upgrade pip + pip install ruff + - name: Run Ruff + run: | + ruff check --output-format=github + ruff format --check From 99776d642924eed026b400172f15f72db9ed2900 Mon Sep 17 00:00:00 2001 From: F2011 Date: Wed, 11 Mar 2026 20:57:14 +0100 Subject: [PATCH 2/5] Update setup-python and checkout actions --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 595b8f3..032ef78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,13 +15,13 @@ jobs: env: DISPLAY: ":99.0" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install system packages run: | sudo apt update sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 libgtk-3-0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -50,9 +50,9 @@ jobs: name: Ruff runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.10" - name: Install pip and ruff From 7469794dbc033e367ca16aa70c98bf748f08a8c7 Mon Sep 17 00:00:00 2001 From: F2011 Date: Wed, 11 Mar 2026 21:01:52 +0100 Subject: [PATCH 3/5] inline lambda expressions implement ruff suggestions --- typstwriter/editor.py | 2 +- typstwriter/mainwindow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typstwriter/editor.py b/typstwriter/editor.py index e760ad1..0b2e823 100644 --- a/typstwriter/editor.py +++ b/typstwriter/editor.py @@ -712,7 +712,7 @@ def __init__(self, parent): self.syntax_combo_box = QtWidgets.QComboBox() for name in sorted(syntax_highlighting.available_lexers(), key=str.lower): self.syntax_combo_box.addItem(name) - self.syntax_combo_box.textActivated.connect(lambda text: self.syntax_changed.emit(text)) + self.syntax_combo_box.textActivated.connect(self.syntax_changed.emit) self.Layout.addStretch() self.Layout.addWidget(self.syntax_combo_box) diff --git a/typstwriter/mainwindow.py b/typstwriter/mainwindow.py index 59efe03..6a99119 100644 --- a/typstwriter/mainwindow.py +++ b/typstwriter/mainwindow.py @@ -148,7 +148,7 @@ def __init__(self): self.CompilerConnector.compilation_finished.connect(self.editor.clear_errors) self.CompilerConnector.error_report.connect(self.editor.apply_errors) state.main_file.Signal.connect(lambda s: self.CompilerConnector.stop()) - state.main_file.Signal.connect(lambda s: self.CompilerOptions.main_changed(s)) + state.main_file.Signal.connect(self.CompilerOptions.main_changed) state.main_file.Signal.connect(lambda s: self.PDFWidget.open(util.pdf_path(s))) # For now only display errors From e004f2f05595c0831c125261ec39fe759458e168 Mon Sep 17 00:00:00 2001 From: Bzero Date: Mon, 23 Mar 2026 02:23:33 +0100 Subject: [PATCH 4/5] Formatting --- .github/workflows/ci.yml | 88 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 032ef78..e6c1da1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,53 +13,53 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] env: - DISPLAY: ":99.0" + DISPLAY: ':99.0' steps: - - uses: actions/checkout@v6 - - name: Install system packages - run: | - sudo apt update - sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 libgtk-3-0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - name: Print Python version - run: python -c "import sys; print(sys.version)" - - name: Install pip - run: | - python -m pip install --upgrade pip - - name: Install typstwriter - run: | - pip install . - pip install .[tests] - - name: Start X - run: | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX - - name: Create trash directory - run: | - sudo mkdir -m 777 /tmp_pytest - - name: Run tests - run: | - pytest - env: - PYTEST_DEBUG_TEMPROOT: /tmp_pytest + - uses: actions/checkout@v6 + - name: Install system packages + run: | + sudo apt update + sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 libgtk-3-0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Print Python version + run: python -c "import sys; print(sys.version)" + - name: Install pip + run: | + python -m pip install --upgrade pip + - name: Install typstwriter + run: | + pip install . + pip install .[tests] + - name: Start X + run: | + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX + - name: Create trash directory + run: | + sudo mkdir -m 777 /tmp_pytest + - name: Run tests + run: | + pytest + env: + PYTEST_DEBUG_TEMPROOT: /tmp_pytest ruff: name: Ruff runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.10" - - name: Install pip and ruff - run: | - python -m pip install --upgrade pip - pip install ruff - - name: Run Ruff - run: | - ruff check --output-format=github - ruff format --check + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.10' + - name: Install pip and ruff + run: | + python -m pip install --upgrade pip + pip install ruff + - name: Run Ruff + run: | + ruff check --output-format=github + ruff format --check From 14008eb5e12a1651854923343f4690c57f8645ed Mon Sep 17 00:00:00 2001 From: Bzero Date: Mon, 23 Mar 2026 02:43:42 +0100 Subject: [PATCH 5/5] Ruff 0.15.0. --- typstwriter/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typstwriter/mainwindow.py b/typstwriter/mainwindow.py index 6a99119..948f0e0 100644 --- a/typstwriter/mainwindow.py +++ b/typstwriter/mainwindow.py @@ -148,7 +148,7 @@ def __init__(self): self.CompilerConnector.compilation_finished.connect(self.editor.clear_errors) self.CompilerConnector.error_report.connect(self.editor.apply_errors) state.main_file.Signal.connect(lambda s: self.CompilerConnector.stop()) - state.main_file.Signal.connect(self.CompilerOptions.main_changed) + state.main_file.Signal.connect(lambda s: self.CompilerOptions.main_changed(s)) # noqa: PLW0108 state.main_file.Signal.connect(lambda s: self.PDFWidget.open(util.pdf_path(s))) # For now only display errors