made linter happy by removing all trailing spaces and unused imports

This commit is contained in:
mcDandy
2025-12-11 18:33:27 +01:00
parent 4abd03eb94
commit 11b5ffcc3a
19 changed files with 484 additions and 431 deletions
+3 -45
View File
@@ -1,15 +1,13 @@
# GitHub CI build pipeline
name: CI build
name: "{{ cookiecutter.project_slug }} CI build"
on:
pull_request:
push:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
runs-on: "{% raw %} ${{ matrix.os }} {% endraw %}"
env:
PYTHONIOENCODING: "utf8"
strategy:
@@ -19,57 +17,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Backup pyproject.toml
run: cp pyproject.toml pyproject.toml.ci.bak
- name: Strip tooltip entries from pyproject.toml for CI
run: |
# Remove `tooltip = ...` from [project] and drop [project.tooltip] section if present.
python - <<'PY'
from pathlib import Path
p = Path('pyproject.toml')
text = p.read_text()
out_lines = []
cur_section = None
skip_section = False
for line in text.splitlines():
s = line.strip()
if s.startswith('[') and s.endswith(']'):
cur_section = s.strip('[]')
# skip any subsection that starts with project.tooltip (or exact match)
if cur_section == 'project.tooltip' or cur_section.startswith('project.tooltip'):
skip_section = True
continue
else:
skip_section = False
if skip_section:
continue
# drop top-level tooltip = ... when inside [project]
if cur_section == 'project' and s and s.split('=')[0].strip() == 'tooltip':
continue
out_lines.append(line)
p.write_text('\n'.join(out_lines) + '\n')
PY
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "{% raw %} ${{ matrix.python-version }} {% endraw %}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Run Linting
run: |
ruff check .
- name: Run Tests
run: |
pytest tests/
- name: Restore original pyproject.toml
if: always()
run: mv pyproject.toml.ci.bak pyproject.toml