[tool.ruff] line-length = 200 # Temporarily relaxed during migration target-version = "py311" [tool.ruff.lint] # Enable flake8-bugbear (`B`) rules, in addition to the `E` and `F` rules that are enabled by default. select = [ # pycodestyle "E", # Pyflakes "F", # flake8-bugbear "B", # flake8-simplify "SIM", # isort "I", # Remove unused imports "F401", ] ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", # Allow boolean positional values in function calls, like `dict.get(... True)` "FBT003", # Ignore checks for possible passwords "S105", "S106", "S107", # Ignore complexity "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", # Ignore import sorting in CI (environment-dependent behavior) "I001", ] [tool.ruff.format] # Like Black, use double quotes for strings. quote-style = "double" # Like Black, indent with spaces, rather than tabs. indent-style = "space" # Like Black, respect magic trailing commas. skip-magic-trailing-comma = false # Like Black, automatically detect the appropriate line ending. line-ending = "auto" [tool.ruff.lint.isort] known-first-party = ["yomitalk"] [tool.mypy] python_version = "3.11" warn_return_any = true warn_unused_configs = true # 既存コードへの型アノテーションを段階的に追加できるように設定を緩和 disallow_untyped_defs = false # 型アノテーションのない関数を許可(警告) disallow_incomplete_defs = false # 不完全な型アノテーションを許可(警告) check_untyped_defs = true # 型アノテーションのない関数のボディをチェック disallow_untyped_decorators = false # 型アノテーションのないデコレータを許可(警告) no_implicit_optional = true strict_optional = true # 将来的には下記の設定を有効にしていく # disallow_untyped_defs = true # disallow_incomplete_defs = true # disallow_untyped_decorators = true # 新規ファイルでは常に厳格に型チェック [[tool.mypy.overrides]] module = ["yomitalk.components.audio_generator", "yomitalk.components.pdf_uploader"] disallow_untyped_defs = true disallow_incomplete_defs = true # 外部ライブラリに対しては型チェックを無視 [[tool.mypy.overrides]] module = ["gradio.*", "PyPDF2.*", "pdfplumber.*", "transformers.*", "torch.*", "selenium.*", "ffmpeg.*", "reportlab.*", "webdriver_manager.*"] ignore_missing_imports = true follow_imports = "skip" [tool.pytest.ini_options] addopts = "--timeout=90 -v --tb=native --durations=10 -v" markers = [ "slow: marks tests as slow running", "requires_voicevox: marks tests that require VOICEVOX Core", "skip: marks tests to be skipped", "e2e: marks end-to-end tests", ]