Skip to content

Commit

Permalink
Also check Python formatting (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche authored Jan 1, 2025
1 parent 02e3af9 commit 24410a0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

fmt:
runs-on: ubuntu-latest
name: "Formatting"
name: "Rust Formatting"
steps:
- uses: actions/checkout@v4

Expand All @@ -60,3 +60,10 @@ jobs:
with:
command: fmt
args: --all -- --check

black:
runs-on: ubuntu-latest
name: "Python Formatting"
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ maturin = { extras = ["patchelf"], version = "^1.5.1" }
[tool.poetry.group.test.dependencies]
pytest = "^8.2.0"
mypy = "^1.10.0"

[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'
23 changes: 3 additions & 20 deletions taskchampion.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ from datetime import datetime
from enum import Enum
from typing import Optional, Iterator


class Replica:
def __init__(self, path: str, create_if_missing: bool): ...
@staticmethod
Expand All @@ -12,7 +11,6 @@ class Replica:
def create_task(self, uuid: str) -> tuple["Task", list["Operation"]]: ...
def all_task_uuids(self) -> list[str]: ...
def all_tasks(self) -> dict[str, "Task"]: ...

def update_task(
self, uuid: str, property: str, value: Optional[str]
) -> dict[str, str]: ...
Expand All @@ -27,13 +25,11 @@ class Replica:
def num_undo_points(self) -> int: ...
def commit_operations(self, operations: list["Operation"]) -> None: ...


class Operation:
@staticmethod
def Create(uuid: str) -> "Operation": ...
@staticmethod
def Delete(uuid: str, old_task: dict[str, str]): ...

@staticmethod
def Update(
uuid: str,
Expand All @@ -45,15 +41,13 @@ class Operation:
@staticmethod
def UndoPoint() -> "Operation": ...


class Status(Enum):
Pending = 1
Completed = 2
Deleted = 3
Recurring = 4
Unknown = 5


class Task:
def get_uuid(self) -> str: ...
def get_status(self) -> "Status": ...
Expand All @@ -80,7 +74,6 @@ class Task:
def set_entry(self, entry: Optional[str]) -> list["Operation"]: ...
def set_wait(self, wait: Optional[str]) -> list["Operation"]: ...
def set_modified(self, modified: Optional[str]) -> list["Operation"]: ...

def set_value(
self, property: str, value: Optional[str]
) -> Optional["Operation"]: ...
Expand All @@ -89,23 +82,16 @@ class Task:
def done(self) -> list["Operation"]: ...
def add_tag(self, tag: "Tag") -> list["Operation"]: ...
def remove_tag(self, tag: "Tag") -> list["Operation"]: ...

def add_annotation(
self, annotation: "Annotation") -> list["Operation"]: ...
def remove_annotation(
self, annotation: "Annotation") -> list["Operation"]: ...

def add_annotation(self, annotation: "Annotation") -> list["Operation"]: ...
def remove_annotation(self, annotation: "Annotation") -> list["Operation"]: ...
def set_due(self, due: Optional[datetime]) -> list["Operation"]: ...
def set_uda(self, namespace: str, key: str,
value: str) -> list["Operation"]: ...

def set_uda(self, namespace: str, key: str, value: str) -> list["Operation"]: ...
def remove_uda(self, namespace: str, key: str) -> list["Operation"]: ...
def set_legacy_uda(self, key: str, value: str) -> list["Operation"]: ...
def remove_legacy_uda(self, key: str) -> list["Operation"]: ...
def add_dependency(self, uuid: str) -> list["Operation"]: ...
def remove_dependency(self, uuid: str) -> list["Operation"]: ...


class WorkingSet:
def __len__(self) -> int: ...
def largest_index(self) -> int: ...
Expand All @@ -115,19 +101,16 @@ class WorkingSet:
def __iter__(self) -> Iterator[tuple[int, str]]: ...
def __next__(self) -> tuple[int, str]: ...


class Annotation:
entry: str
description: str

def __init__(self) -> None: ...


class DependencyMap:
def dependencies(self, dep_of: str) -> list[str]: ...
def dependents(self, dep_on: str) -> list[str]: ...


class Tag:
def __init__(self, tag: str): ...
def is_synthetic(self) -> bool: ...
Expand Down
1 change: 1 addition & 0 deletions tests/test_replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest
from taskchampion import Replica


@pytest.fixture
def empty_replica() -> Replica:
return Replica.new_in_memory()
Expand Down

0 comments on commit 24410a0

Please sign in to comment.