Skip to content

Commit c4f650d

Browse files
authored
feat: add lint workflow (#29)
* feat: add lint workflow * exp: load venv * exp: add dev dependencies * fix: fix errors found by linter * exp: use pdm to run ruff and mypy * exp: try matrix of Python versions * exp: python versions * fix: set minimum version to python 3.10 * feat: also run it on main * chore: bump Python to 3.11 because of tomlib * chore: improve readme
1 parent ffc82d7 commit c4f650d

File tree

6 files changed

+128
-5
lines changed

6 files changed

+128
-5
lines changed

.github/workflows/pull_request.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Pull Request CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches: main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Set up PDM
28+
uses: pdm-project/setup-pdm@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: true
32+
33+
- name: Install dependencies
34+
run: |
35+
python --version
36+
pdm install --frozen-lockfile
37+
38+
- name: Run Ruff
39+
run: pdm run ruff check
40+
41+
- name: Run MyPy
42+
run: pdm run mypy --python-version=${{ matrix.python-version }} src
43+

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# CursedTodo
22

3+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/flchs/cursedtodo/pull_request.yml?branch=main)
34
![GitHub Release](https://img.shields.io/github/v/release/flchs/cursedtodo?include_prereleases)
45
![GitHub License](https://img.shields.io/github/license/flchs/cursedtodo)
5-
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/flchs/cursedtodo/release.yml)
6+
![CI](https://img.shields.io/github/actions/workflow/status/flchs/cursedtodo/release.yml)
67
![PyPI - Downloads](https://img.shields.io/pypi/dw/cursedtodo)
78

89
CursedTodo is a minimalist, terminal base todo manager storing tasks as `.ics` files for storage.

pdm.lock

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = [
55
{name = "François Lachèse", email = "francois.lachese@gmail.com"},
66
]
77
dependencies = ["ics>=0.7.2,<0.8"]
8-
requires-python = ">=3.12"
8+
requires-python = ">=3.11"
99
readme = "README.md"
1010
license = {text = "MIT"}
1111
dynamic = ["version"]
@@ -30,6 +30,7 @@ debug = "python -m debugpy --listen 127.0.0.1:5678 --wait-for-client -m cursedto
3030
[tool.mypy]
3131
mypy_path = "src/"
3232
strict = true
33+
disable_error_code = "unused-ignore"
3334

3435
[[tool.mypy.overrides]]
3536
module = "ics.*"
@@ -38,4 +39,6 @@ ignore_missing_imports = true
3839
[dependency-groups]
3940
dev = [
4041
"debugpy>=1.8.11",
42+
"ruff>=0.9.6",
43+
"mypy>=1.15.0",
4144
]

src/cursedtodo/controlers/edit_todo_controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from datetime import datetime
2-
from os import name
32
from typing import Any
43
from cursedtodo.config import Config
54
from cursedtodo.controlers.base_controller import Controller

src/cursedtodo/models/calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from typing import Optional
44

5-
from cursedtodo.utils.colors import WHITE, get_color
5+
from cursedtodo.utils.colors import get_color
66

77

88
@dataclass

0 commit comments

Comments
 (0)