[tool.ruff]
# Ignore automatically generated protobuf files
# Ignore test files (test_*.py and *_test.py)
# Ignore diagnosis directory
exclude = [
    "**/*_pb2.py",
    "**/*_pb2_grpc.py",
    "**/test_*.py",
    "**/*_test.py",
    "diagnosis/**",
    "tools/**",
    "test/**",
    "slowquery/**"
]

[tool.ruff.lint]
# Note: STR100 and PIC100 are PyCharm Security rules, not Ruff rules.
# They are handled in GitHub Actions workflow with fail_on_warnings: "no"

[tool.pytest.ini_options]
# Configure pytest to only collect tests from project directories
# Ignore virtual environments and site-packages
norecursedirs = [
    ".venv",
    "venv",
    "env",
    "__pycache__",
    ".git",
    "build",
    "dist",
    "*.egg-info",
]
testpaths = [
    "test",
    "tests",
    "o11ydiagnosis",
]
python_files = [
    "test_*.py",
    "*_test.py",
]
python_classes = [
    "Test*",
]
python_functions = [
    "test_*",
]

[tool.coverage.run]
source = ["."]
omit = [
    "*/test/*",
    "*/tests/*",
    "*/__pycache__/*",
    "*/.venv/*",
    "*/venv/*",
    "*/env/*",
    "*/build/*",
    "*/dist/*",
    "*/slowquery/*",
    "*/diagnosis/*",
    "*/datasdk/utils/coresvc/*",
    "*/datasdk/utils/objstorage/*",
    "*/o11ydiagnosis/serverless/*",
    "*/tools/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
    "if False:",
    "class .*\\bProtocol\\):",
    "@(abc\\.)?abstractmethod",
]

