fix-ruff-lint

This commit is contained in:
Your Name 2025-01-20 10:31:01 -05:00 committed by Henri Dickson
parent ad1e6fb8c4
commit 1738280a2c
10 changed files with 16 additions and 15 deletions

View file

@ -25,9 +25,10 @@ repos:
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
rev: v0.9.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
# - repo: https://github.com/pycqa/isort

View file

@ -130,7 +130,7 @@ class BangumiDramaTestCase(TestCase):
def test_scrape(self):
t_url = "https://bgm.tv/subject/224973"
site = SiteManager.get_site_by_url(t_url)
resource = site.get_resource_ready()
site.get_resource_ready()
item = site.get_item()
self.assertEqual(item.display_title, "超级弹丸论破2舞台剧~再见了绝望学园~2017")
self.assertEqual(
@ -145,7 +145,7 @@ class BangumiDramaTestCase(TestCase):
t_url = "https://bgm.tv/subject/442025"
site = SiteManager.get_site_by_url(t_url)
resource = site.get_resource_ready()
site.get_resource_ready()
item = site.get_item()
self.assertEqual(item.display_title, "LIVE STAGE「ぼっち・ざ・ろっく")
self.assertEqual(

View file

@ -1,10 +1,10 @@
import logging
from typing import Any
from collections import OrderedDict
from loguru import logger
import httpx
from typing import Any
import httpx
from django.conf import settings
from loguru import logger
from catalog.book.utils import detect_isbn_asin
from catalog.common import *
@ -104,7 +104,7 @@ class Bangumi(AbstractSite):
release_type = GameReleaseType.DLC
case _:
raise ValueError(
f"Unknown type {o['type']} for bangumi subject {o["id"]}"
f"Unknown type {o['type']} for bangumi subject {o['id']}"
)
return category, {
"preferred_model": model,
@ -138,7 +138,7 @@ class Bangumi(AbstractSite):
}
if category not in bgm_type:
return results
search_url = f"https://api.bgm.tv/v0/search/subjects?limit={page_size}&offset={(page-1)*page_size}"
search_url = f"https://api.bgm.tv/v0/search/subjects?limit={page_size}&offset={(page - 1) * page_size}"
async with httpx.AsyncClient() as client:
try:
response = await client.post(

View file

@ -6,7 +6,6 @@ ref: https://boardgamegeek.com/wiki/page/BGG_XML_API2
import html
from catalog.common import *
from catalog.game.models import GameReleaseType
from catalog.models import *

View file

@ -1,6 +1,7 @@
import json
import logging
import re
from catalog.common import *
from catalog.movie.models import *
from catalog.tv.models import *

View file

@ -33,7 +33,6 @@ from .search import search
from .tag import user_tag_edit, user_tag_list, user_tag_member_list
from .wrapped import WrappedShareView, WrappedView
__all__ = [
"add_to_collection",
"collection_add_featured",

View file

@ -1,7 +1,6 @@
from django.core.signing import b62_encode
from django.shortcuts import get_object_or_404, redirect
from .models import *

View file

@ -118,6 +118,7 @@ exclude = [
"neodb",
]
lint.ignore = ["F403", "F405"]
lint.extend-select = ["I"]
[tool.setuptools]
py-modules = []

View file

@ -9,8 +9,9 @@ from django.core.files.images import ImageFile
from django.core.signing import b62_encode
from django.db.models import Count
from django.utils import timezone
from PIL import Image
from loguru import logger
from PIL import Image
from .models import *
if TYPE_CHECKING:

View file

@ -1,10 +1,10 @@
import httpx
from django.core.management.base import BaseCommand
from tqdm import tqdm
import httpx
from users.models import Preference, User
from takahe.models import Identity, Domain
from takahe.models import Domain, Identity
from takahe.utils import Takahe
from users.models import Preference, User
class Command(BaseCommand):