mirror of
https://github.com/catppuccin/python.git
synced 2026-02-05 04:17:45 +08:00
ci: add lint workflow
This commit is contained in:
parent
c12487e7ba
commit
279fc38ba6
26
.github/workflows/lint.yaml
vendored
Normal file
26
.github/workflows/lint.yaml
vendored
Normal 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
23
.github/workflows/test.yaml
vendored
Normal 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
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user