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 2f1e331
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install .[test]
- name: Validate formatting with Ruff
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 2f1e331

Please sign in to comment.