refactor: modernize code quality tooling with Ruff
- Replace black, isort, and flake8 with Ruff (all-in-one linter and formatter) - Add comprehensive pyproject.toml configuration - Simplify Makefile code quality targets - Configure exclusions for venv/.venv in pyproject.toml - Auto-fix 1,359 linting issues across codebase Benefits: - Much faster builds (Ruff is written in Rust) - Single tool replaces multiple tools - More comprehensive rule set (UP, B, C4, SIM, PIE, RET, Q) - All configuration centralized in pyproject.toml - Better import sorting and formatting consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,6 @@ This module provides classes and functions for:
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import pandas as pd
|
||||
|
||||
@@ -21,7 +20,7 @@ class GTINProcessor:
|
||||
|
||||
VALID_LENGTHS = [8, 12, 13, 14] # List of valid GTIN lengths
|
||||
|
||||
def normalize(self, gtin_value: any) -> Optional[str]:
|
||||
def normalize(self, gtin_value: any) -> str | None:
|
||||
"""
|
||||
Normalize GTIN to proper format.
|
||||
|
||||
@@ -55,11 +54,11 @@ class GTINProcessor:
|
||||
# Standard lengths - pad appropriately
|
||||
if length == 8:
|
||||
return gtin_clean.zfill(8) # EAN-8
|
||||
elif length == 12:
|
||||
if length == 12:
|
||||
return gtin_clean.zfill(12) # UPC-A
|
||||
elif length == 13:
|
||||
if length == 13:
|
||||
return gtin_clean.zfill(13) # EAN-13
|
||||
elif length == 14:
|
||||
if length == 14:
|
||||
return gtin_clean.zfill(14) # GTIN-14
|
||||
|
||||
elif length > 14:
|
||||
@@ -111,7 +110,7 @@ class PriceProcessor:
|
||||
|
||||
def parse_price_currency(
|
||||
self, price_str: any
|
||||
) -> Tuple[Optional[str], Optional[str]]:
|
||||
) -> tuple[str | None, str | None]:
|
||||
"""
|
||||
Parse a price string to extract the numeric value and currency.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user