fix-ruff-lint
This commit is contained in:
parent
ad1e6fb8c4
commit
1738280a2c
10 changed files with 16 additions and 15 deletions
|
@ -25,9 +25,10 @@ repos:
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.9.1
|
rev: v0.9.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
|
args: [ --fix ]
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
||||||
# - repo: https://github.com/pycqa/isort
|
# - repo: https://github.com/pycqa/isort
|
||||||
|
|
|
@ -130,7 +130,7 @@ class BangumiDramaTestCase(TestCase):
|
||||||
def test_scrape(self):
|
def test_scrape(self):
|
||||||
t_url = "https://bgm.tv/subject/224973"
|
t_url = "https://bgm.tv/subject/224973"
|
||||||
site = SiteManager.get_site_by_url(t_url)
|
site = SiteManager.get_site_by_url(t_url)
|
||||||
resource = site.get_resource_ready()
|
site.get_resource_ready()
|
||||||
item = site.get_item()
|
item = site.get_item()
|
||||||
self.assertEqual(item.display_title, "超级弹丸论破2舞台剧~再见了绝望学园~2017")
|
self.assertEqual(item.display_title, "超级弹丸论破2舞台剧~再见了绝望学园~2017")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -145,7 +145,7 @@ class BangumiDramaTestCase(TestCase):
|
||||||
|
|
||||||
t_url = "https://bgm.tv/subject/442025"
|
t_url = "https://bgm.tv/subject/442025"
|
||||||
site = SiteManager.get_site_by_url(t_url)
|
site = SiteManager.get_site_by_url(t_url)
|
||||||
resource = site.get_resource_ready()
|
site.get_resource_ready()
|
||||||
item = site.get_item()
|
item = site.get_item()
|
||||||
self.assertEqual(item.display_title, "LIVE STAGE「ぼっち・ざ・ろっく!」")
|
self.assertEqual(item.display_title, "LIVE STAGE「ぼっち・ざ・ろっく!」")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from loguru import logger
|
from typing import Any
|
||||||
import httpx
|
|
||||||
|
|
||||||
|
import httpx
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
from catalog.book.utils import detect_isbn_asin
|
from catalog.book.utils import detect_isbn_asin
|
||||||
from catalog.common import *
|
from catalog.common import *
|
||||||
|
@ -104,7 +104,7 @@ class Bangumi(AbstractSite):
|
||||||
release_type = GameReleaseType.DLC
|
release_type = GameReleaseType.DLC
|
||||||
case _:
|
case _:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Unknown type {o['type']} for bangumi subject {o["id"]}"
|
f"Unknown type {o['type']} for bangumi subject {o['id']}"
|
||||||
)
|
)
|
||||||
return category, {
|
return category, {
|
||||||
"preferred_model": model,
|
"preferred_model": model,
|
||||||
|
|
|
@ -6,7 +6,6 @@ ref: https://boardgamegeek.com/wiki/page/BGG_XML_API2
|
||||||
|
|
||||||
import html
|
import html
|
||||||
|
|
||||||
|
|
||||||
from catalog.common import *
|
from catalog.common import *
|
||||||
from catalog.game.models import GameReleaseType
|
from catalog.game.models import GameReleaseType
|
||||||
from catalog.models import *
|
from catalog.models import *
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from catalog.common import *
|
from catalog.common import *
|
||||||
from catalog.movie.models import *
|
from catalog.movie.models import *
|
||||||
from catalog.tv.models import *
|
from catalog.tv.models import *
|
||||||
|
|
|
@ -33,7 +33,6 @@ from .search import search
|
||||||
from .tag import user_tag_edit, user_tag_list, user_tag_member_list
|
from .tag import user_tag_edit, user_tag_list, user_tag_member_list
|
||||||
from .wrapped import WrappedShareView, WrappedView
|
from .wrapped import WrappedShareView, WrappedView
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"add_to_collection",
|
"add_to_collection",
|
||||||
"collection_add_featured",
|
"collection_add_featured",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
from django.core.signing import b62_encode
|
from django.core.signing import b62_encode
|
||||||
from django.shortcuts import get_object_or_404, redirect
|
from django.shortcuts import get_object_or_404, redirect
|
||||||
|
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ exclude = [
|
||||||
"neodb",
|
"neodb",
|
||||||
]
|
]
|
||||||
lint.ignore = ["F403", "F405"]
|
lint.ignore = ["F403", "F405"]
|
||||||
|
lint.extend-select = ["I"]
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
py-modules = []
|
py-modules = []
|
||||||
|
|
|
@ -9,8 +9,9 @@ from django.core.files.images import ImageFile
|
||||||
from django.core.signing import b62_encode
|
from django.core.signing import b62_encode
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from PIL import Image
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
import httpx
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import httpx
|
|
||||||
|
|
||||||
from users.models import Preference, User
|
from takahe.models import Domain, Identity
|
||||||
from takahe.models import Identity, Domain
|
|
||||||
from takahe.utils import Takahe
|
from takahe.utils import Takahe
|
||||||
|
from users.models import Preference, User
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|
Loading…
Add table
Reference in a new issue