[project]
name = "odsparsator"
version = "1.12.2"
description = "Generate a json file from an OpenDocument Format .ods file"
authors = [{ name = "Jérôme Dumonteil", email = "jerome.dumonteil@gmail.com" }]
requires-python = ">=3.9,<4"
readme = "README.md"
license = "MIT"
keywords = ["openDocument", "ODF", "ods", "json", "spreadsheet", "parser"]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Operating System :: OS Independent",
    "Topic :: Text Processing",
    "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["odfdo>=3.7.7"]

[project.urls]
Homepage = "https://github.com/jdum/odsparsator"
Repository = "https://github.com/jdum/odsparsator"

[project.scripts]
odsparsator = "odsparsator.cli:main"

[dependency-groups]
doc = ["sphinx>=7.0", "myst-parser>=2.0.0"]
dev = ["pytest>=8.0", "tox>=4", "ruff>=0.11.0", "isort>=6.0", "coverage>=7.0"]

[tool.uv]
default-groups = ["doc", "dev"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.isort]
profile = "black"

[tool.ruff]
exclude = [".venv"]
# Same as Black.
line-length = 88
indent-width = 4
target-version = "py313"

[tool.ruff.lint]
select = [
    # flake8-2020
    "YTT",
    # flake8-bandit
    "S",
    # flake8-bugbear
    "B",
    # flake8-builtins
    "A",
    # flake8-comprehensions
    "C4",
    # flake8-debugger
    "T10",
    # flake8-simplify
    "SIM",
    # isort
    "I",
    # mccabe
    "C90",
    # pycodestyle
    "E",
    "W",
    # pyflakes
    "F",
    # pygrep-hooks
    "PGH",
    # pyupgrade
    "UP",
    # ruff
    "RUF",
    # tryceratops
    "TRY",
]
ignore = [
    # LineTooLong
    "E501",
    # DoNotAssignLambda
    "E731",
    # Use specific rule codes when ignoring type issues
    "PGH003",
    # check for execution of untrusted input
    "S603",
    # Class attribute `open` is shadowing a Python builtin
    "A003",
    # Use `X | Y` in `isinstance` call instead of `(X, Y)`
    "UP038",
    # Avoid specifying long messages outside the exception class
    "TRY003",
    # Use ternary operator
    "SIM108",
    # Use of `assert` detected
    "S101",
]

[tool.ruff.lint.per-file-ignores]
"tests/test_*" = ["S101"]

[tool.coverage.report]
skip_empty = true

[tool.coverage.run]
branch = true
source = ["odsparsator"]

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
