Skip to content

Commit

Permalink
add ruff and check formatting in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nudded committed Aug 30, 2024
1 parent d71ed7f commit 8ba4d79
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install .[test]
- uses: chartboost/ruff-action@v1
15 changes: 12 additions & 3 deletions lago_python_client/models/plan.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from typing import List, Optional

from lago_python_client.base_model import BaseModel
from lago_python_client.models.usage_threshold import UsageThreshold

from .charge import Charges, ChargesResponse, ChargesOverrides
from .usage_threshold import UsageThresholds, UsageThresholdsResponse, UsageThresholdsOverrides
from .minimum_commitment import MinimumCommitment, MinimumCommitmentResponse, MinimumCommitmentOverrides
from .usage_threshold import (
UsageThreshold,
UsageThresholds,
UsageThresholdsResponse,
UsageThresholdsOverrides,
)
from .minimum_commitment import (
MinimumCommitment,
MinimumCommitmentResponse,
MinimumCommitmentOverrides,
)
from .tax import Taxes, TaxesResponse
from ..base_model import BaseResponseModel

Expand Down Expand Up @@ -47,6 +55,7 @@ class PlanResponse(BaseResponseModel):
draft_invoices_count: int
taxes: Optional[TaxesResponse]


class PlanOverrides(BaseModel):
name: Optional[str]
invoice_display_name: Optional[str]
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = [
"setuptools>=54",
"wheel"
]
requires = ["setuptools>=54", "wheel"]
build-backend = "setuptools.build_meta"

[tool.ruff.lint]
extend-select = ['E305']
preview = true

0 comments on commit 8ba4d79

Please sign in to comment.