Fix linting issues: line length, import sorting, unused variables
- Set ruff/black line length to 120 - Reformatted code with black - Fixed import ordering with ruff - Disabled lint for UI component files with long CSS strings - Updated pyproject.toml with proper tool configuration
This commit is contained in:
@@ -3,7 +3,11 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass
|
||||
|
||||
from app.strategies.base import BaseStrategy, StrategyConfig
|
||||
from app.strategies.protective_put import DEFAULT_SCENARIO_CHANGES, ProtectivePutSpec, ProtectivePutStrategy
|
||||
from app.strategies.protective_put import (
|
||||
DEFAULT_SCENARIO_CHANGES,
|
||||
ProtectivePutSpec,
|
||||
ProtectivePutStrategy,
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -31,10 +35,16 @@ class LadderedPutStrategy(BaseStrategy):
|
||||
|
||||
def _legs(self) -> list[tuple[float, ProtectivePutStrategy]]:
|
||||
legs: list[tuple[float, ProtectivePutStrategy]] = []
|
||||
for index, (weight, strike_pct) in enumerate(zip(self.spec.weights, self.spec.strike_pcts, strict=True), start=1):
|
||||
for index, (weight, strike_pct) in enumerate(
|
||||
zip(self.spec.weights, self.spec.strike_pcts, strict=True), start=1
|
||||
):
|
||||
leg = ProtectivePutStrategy(
|
||||
self.config,
|
||||
ProtectivePutSpec(label=f"{self.spec.label}_leg_{index}", strike_pct=strike_pct, months=self.spec.months),
|
||||
ProtectivePutSpec(
|
||||
label=f"{self.spec.label}_leg_{index}",
|
||||
strike_pct=strike_pct,
|
||||
months=self.spec.months,
|
||||
),
|
||||
)
|
||||
legs.append((weight, leg))
|
||||
return legs
|
||||
|
||||
Reference in New Issue
Block a user