ci: add lint workflow

This commit is contained in:
backwardspy 2022-11-03 23:24:30 +00:00 committed by Hamothy
parent c12487e7ba
commit 279fc38ba6
3 changed files with 51 additions and 1 deletions

26
.github/workflows/lint.yaml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Lint
on:
push:
paths:
- '**.py'
jobs:
lint:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.2"
- run: poetry config virtualenvs.create false
- run: poetry install
- run: isort --check .
- run: black --check .
- run: pylint catppuccin.py
- run: mypy .

23
.github/workflows/test.yaml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Test
on:
push:
paths:
- '**.py'
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.2"
- run: poetry config virtualenvs.create false
- run: poetry install
- run: pytest --cov catppuccin

View File

@ -1,5 +1,6 @@
"""🐍 Soothing pastel theme for Python."""
from dataclasses import dataclass
from typing import Tuple
@dataclass(frozen=True)
@ -11,7 +12,7 @@ class Colour:
blue: int
@property
def rgb(self) -> tuple[int, int, int]:
def rgb(self) -> Tuple[int, int, int]:
"""Get the colour as a 3-tuple of red, green, and blue."""
return (self.red, self.green, self.blue)