[project] name = "linkedin-search-backend" version = "1.0.0" description = "LinkedIn dataset search engine - Django/DRF backend" requires-python = ">=3.12" # --------------------------------------------------------------------------- # Ruff: linting + import sorting (replaces flake8/isort) # --------------------------------------------------------------------------- [tool.ruff] line-length = 100 target-version = "py312" exclude = ["migrations", ".venv", "staticfiles"] [tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "B", # flake8-bugbear "C4", # flake8-comprehensions "DJ", # flake8-django "UP", # pyupgrade "S", # bandit (security) "SIM", # flake8-simplify "RET", # flake8-return "ARG", # unused arguments ] ignore = [ "S101", # assert is fine inside tests "B008", # function call in argument defaults (common in DRF) ] [tool.ruff.lint.per-file-ignores] "tests/*" = ["S105", "S106", "ARG001", "ARG002", "ARG005"] # The repair fixtures are raw CSV rows; wrapping them would change the input. "tests/test_dataset_repair.py" = ["E501"] "*/settings/*" = ["F403", "F405"] [tool.ruff.lint.isort] known-first-party = ["apps", "config"] [tool.ruff.lint.flake8-unused-arguments] # Django and DRF hand every hook `*args`/`**kwargs` whether it needs them or not. ignore-variadic-names = true # --------------------------------------------------------------------------- # Black: formatting # --------------------------------------------------------------------------- [tool.black] line-length = 100 target-version = ["py312"] extend-exclude = "migrations" # --------------------------------------------------------------------------- # Pytest # --------------------------------------------------------------------------- [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "config.settings.test" python_files = ["test_*.py"] addopts = "-ra --strict-markers --cov=apps --cov-report=term-missing" testpaths = ["tests"] filterwarnings = ["ignore::DeprecationWarning"] [tool.coverage.run] omit = ["*/migrations/*", "*/tests/*", "manage.py", "config/asgi.py", "config/wsgi.py"] # --------------------------------------------------------------------------- # Bandit (security linting) # --------------------------------------------------------------------------- [tool.bandit] exclude_dirs = ["tests", "migrations", ".venv", "staticfiles"] skips = ["B101"] # asserts are only used in tests # --------------------------------------------------------------------------- # Mypy # --------------------------------------------------------------------------- [tool.mypy] python_version = "3.12" plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] ignore_missing_imports = true warn_unused_ignores = true warn_redundant_casts = true exclude = ["migrations"] [tool.django-stubs] django_settings_module = "config.settings.dev"