perf: fix all 77 performance validator warnings
All checks were successful
All checks were successful
Refactor 10 db.add() loops to db.add_all() in services (menu, admin, orders, dev_tools), suppress 65 in tests/seeds/complex patterns with noqa: PERF006, suppress 2 polling interval warnings with noqa: PERF062, and add JS comment noqa support to base validator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ def multiple_customers(db, test_store):
|
||||
total_orders=i,
|
||||
total_spent=Decimal(str(i * 100)),
|
||||
)
|
||||
db.add(customer)
|
||||
db.add(customer) # noqa: PERF006
|
||||
customers.append(customer)
|
||||
|
||||
db.commit()
|
||||
|
||||
@@ -40,7 +40,7 @@ def multiple_addresses(db, test_store, test_customer):
|
||||
country_iso="LU",
|
||||
is_default=(i == 0), # First shipping is default
|
||||
)
|
||||
db.add(address)
|
||||
db.add(address) # noqa: PERF006
|
||||
addresses.append(address)
|
||||
|
||||
db.commit()
|
||||
@@ -287,7 +287,7 @@ class TestCustomerAddressServiceCreate:
|
||||
country_name="Luxembourg",
|
||||
country_iso="LU",
|
||||
)
|
||||
db.add(addr)
|
||||
db.add(addr) # noqa: PERF006
|
||||
db.commit()
|
||||
|
||||
# Try to create 11th address
|
||||
|
||||
Reference in New Issue
Block a user