adding ruff auto check for pull requests as well as fixing all ruff errors (#1)

Co-authored-by: Kadir <git@k8n.dev>
This commit is contained in:
Kadir 2025-09-14 19:40:18 +01:00 committed by GitHub
parent b1e0a414cf
commit 4c23acdb55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 10 deletions

View file

@ -6,7 +6,8 @@ import logging
import pathlib
from typing import Any
from listing_processor import ListingProcessor
from rec.query import listing_query, QueryParameters
from rec.query import listing_query
from models.listing import QueryParameters
from rec.districts import get_districts
from repositories import ListingRepository
from tqdm.asyncio import tqdm
@ -35,7 +36,7 @@ async def dump_listings_full(
# logger.debug("Completed floorplan detection")
# refresh listings
listings = await repository.get_listings(parameters) # this can be better
new_listings = [l for l in listings if l.id in new_listings]
new_listings = [x for x in listings if x.id in new_listings]
return new_listings
@ -77,7 +78,7 @@ async def dump_listings(
listings.append(listing)
# if listing is already in db, do not fetch details again
all_listing_ids = [l.id for l in await repository.get_listings()]
all_listing_ids = [x.id for x in await repository.get_listings()]
missing_listing = [
listing for listing in listings if listing.identifier not in all_listing_ids
]
@ -88,7 +89,7 @@ async def dump_listings(
processed_listings = await tqdm.gather(
*[listing_processor.process_listing(id) for id in missing_ids]
)
filtered_listings = [l for l in processed_listings if l is not None]
filtered_listings = [x for x in processed_listings if x is not None]
return filtered_listings