
[tool.pytest.ini_options]
addopts = """
--cov-report=term \
--cov-report=xml:coverage.xml \
--cov={{ package_name }} \
-ra
-vv"""

[tool.coverage.report]
fail_under = 0
show_missing = true
exclude_lines = ["pragma: no cover", "raise NotImplementedError"]

[tool.ruff.format]
docstring-code-format = true

[tool.ruff]
line-length = 88
show-fixes = true

[tool.ruff.lint]
select = [
    "E",    # pycodestyle
    "F",    # pyflakes
    "I",    # isort
    "D",    # pydocstyle
    "D401", # First line should be in imperative mood
    "T201",
    "UP",
]
ignore = [
    "UP006",
    "UP007",
    # We actually do want to import from typing_extensions
    "UP035",
    # Relax the convention by _not_ requiring documentation for every function parameter.
    "D417",
    "E501",
] # Ruff format takes care of line-too-long
exclude = ["notebooks/*"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "UP"]
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.commitizen]
name = "cz_customize"
use_shortcuts = true
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = true
major_version_zero = true
bump_message = "bump: {{ package_name }} version $current_version → $new_version"
tag_format = "{{ package_name }}-$version"

[tool.commitizen.customize]
message_template = "{{"{{change_type}}"}}({{ package_name }}): {{"{{message}}"}}"
example = "feature: this feature enable customize through config file"
schema = "<change_type>: <body>"
schema_pattern = "(feature|bug fix):(\\s.*)"
bump_pattern = "^(break|new|fix|hotfix)"
bump_map = { "break" = "MAJOR", "new" = "MINOR", "fix" = "PATCH", "hotfix" = "PATCH" }
change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"]
commit_parser = "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?"
changelog_pattern = "^(feature|bug fix)?(!)?"
change_type_map = { "feature" = "Feat", "bug fix" = "Fix" }

[[tool.commitizen.customize.questions]]
type = "list"
name = "change_type"
message = "Select the type of change you are committing"
choices = [
    { key = "x", value = "fix", name = "fix: A bug fix. Correlates with PATCH in SemVer" },
    { key = "f", value = "feat", name = "feat: A new feature. Correlates with MINOR in SemVer" },
    { key = "d", value = "docs", name = "docs: Documentation only changes" },
    { key = "s", value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)" },
    { key = "r", value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature" },
    { key = "p", value = "perf", name = "perf: A code change that improves performance" },
    { key = "t", value = "test", name = "test: Adding missing or correcting existing tests" },
    { key = "b", value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)" },
    { key = "c", value = "ci", name = "ci: Changes to CI configuration files and scripts (example scopes: GitLabCI)" },
]


[[tool.commitizen.customize.questions]]
type = "input"
name = "message"
message = "Message:"