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

[dependency-groups]
dev = [
  "commitizen>=4.13.9",
  "cz-path>=0.0.6",
  "mypy>=1.19.1",
  "ruff>=0.15.7",
  "types-jsonnet>=0.21.0.20250708",
  "yapf>=0.43.0",
]
docs = [
  "autodoc-pydantic>=2.2.0",
  "doc8>=2.0.0",
  "docutils<0.22",
  "enum-tools[sphinx]>=0.13.0",
  "esbonio>=1.1.0",
  "numpydoc>=1.10.0",
  "restructuredtext-lint>=2.0.2",
  "sphinx-click>=6.2.0",
  "sphinx-datatables>=1.0.0",
  "sphinx-immaterial>=0.13.9",
  "sphinx>=9.1.0; python_version >= \"3.13\"",
  "tomlkit>=0.14.0",
]
tests = [
  "coveralls>=4.1.0",
  "mock>=5.2.0",
  "pytest-asyncio>=1.3.0",
  "pytest-cov>=7.1.0",
  "pytest-mock>=3.15.1",
  "pytest>=9.0.2",
]

[project]
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Developers",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Programming Language :: Python :: 3.14",
  "Typing :: Typed",
]
dependencies = [
  "aiofiles>=25.1.0",
  "aiohttp-client-cache[filesystem]>=0.14.3",
  "aiohttp>=3.13.3",
  "anyio>=4.13.0",
  "bascom>=0.1.2",
  "beautifulsoup4>=4.14.3",
  "click>=8.3.1",
  "fastmcp>=3.1.1",
  "jinja2>=3.1.6",
  "jsonnet>=0.22.0",
  "keyring>=25.7.0",
  "lxml>=6.0.2",
  "tomlkit>=0.14.0",
  "typing-extensions>=4.15.0",
]
description = "A highly opinionated way to generate and maintain projects with Jsonnet."
keywords = ["command line", "python"]
license = "MIT"
name = "wiswa"
readme = "README.md"
requires-python = ">=3.10,<4.0"
version = "0.0.1"

[[project.authors]]
email = "audvare@gmail.com"
name = "Andrew Udvare"

[project.scripts]
wiswa = "wiswa.main:main"
wiswa-mcp = "wiswa.mcp:main"

[project.urls]
Issues = "https://github.com/Tatsh/wiswa/issues"
documentation = "https://wiswa.readthedocs.org"
homepage = "https://tatsh.github.io/wiswa/"
repository = "https://github.com/Tatsh/wiswa"

[tool.commitizen]
name = "cz_path"
remove_path_prefixes = ["include", "src", "wiswa"]
tag_format = "v$version"
version_files = [
  ".wiswa.jsonnet",
  "CITATION.cff",
  "README.md",
  "docs/badges.rst",
  "docs/index.rst",
  "man/wiswa.1",
  "package.json",
  "snapcraft.yaml",
  "wiswa/__init__.py",
]
version_provider = "pep621"

[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:"]
omit = [
  "__main__.py",
  "conftest.py",
  "tests.py",
  "tests/*/test_*.py",
  "tests/test_*.py",
  "typing.py",
]
show_missing = true

[tool.coverage.run]
branch = true
omit = [
  "__main__.py",
  "conftest.py",
  "tests.py",
  "tests/*/test_*.py",
  "tests/test_*.py",
  "typing.py",
]

[tool.doc8]
max-line-length = 100

[tool.hatch.build.targets.wheel]
packages = ["wiswa", "wiswa-jsonnet"]

[tool.mypy]
cache_dir = "~/.cache/mypy"
explicit_package_bases = true
platform = "linux"
python_version = "3.10"
show_column_numbers = true
strict = true
strict_optional = true
warn_unreachable = true

[tool.pyright]
deprecateTypingAliases = true
enableExperimentalFeatures = true
exclude = [".venv", "**/node_modules", "**/__pycache__", "**/.*"]
include = ["./wiswa", "./tests"]
pythonPlatform = "Linux"
pythonVersion = "3.10"
reportCallInDefaultInitializer = "warning"
reportImplicitOverride = "warning"
reportImportCycles = "error"
reportMissingModuleSource = "error"
reportPropertyTypeMismatch = "error"
reportUnnecessaryTypeIgnoreComment = "none"
typeCheckingMode = "off"
useLibraryCodeForTypes = false

[tool.pytest.ini_options]
asyncio_mode = "auto"
mock_use_standalone_module = true
norecursedirs = ["node_modules"]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
testpaths = ["tests"]

[tool.ruff]
cache-dir = "~/.cache/ruff"
force-exclude = true
line-length = 100
namespace-packages = ["docs", "tests", "wiswa/static"]
target-version = "py310"
unsafe-fixes = true

[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
preview = true
quote-style = "single"

[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
  "ANN401",
  "COM812",
  "CPY001",
  "D201",
  "D203",
  "D204",
  "D212",
  "DOC201",
  "N818",
  "S101",
  "S404",
  "S603",
  "TD002",
  "UP046",
  "UP047",
]
preview = true

[tool.ruff.lint.flake8-builtins]
allowed-modules = ["types", "typing"]

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "double"

[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
from-first = true
required-imports = ["from __future__ import annotations"]
section-order = ["future", "standard-library", "third-party", "local-folder"]

[tool.ruff.lint.mccabe]
max-complexity = 20

[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["test_*"]

[tool.ruff.lint.per-file-ignores]
"main.py" = ["PLR0913"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.pylint]
max-args = 20
max-branches = 20
max-locals = 20
max-positional-args = 15
max-public-methods = 30
max-returns = 10
max-statements = 100

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

[tool.yapf]
align_closing_bracket_with_visual_indent = true
allow_multiline_dictionary_keys = false
allow_multiline_lambdas = false
allow_split_before_dict_value = true
blank_line_before_class_docstring = false
blank_line_before_module_docstring = false
blank_line_before_nested_class_or_def = false
blank_lines_around_top_level_definition = 2
coalesce_brackets = true
column_limit = 100
continuation_align_style = "SPACE"
continuation_indent_width = 4
dedent_closing_brackets = false
disable_ending_comma_heuristic = false
each_dict_entry_on_separate_line = true
indent_dictionary_value = true
indent_width = 4
join_multiple_lines = true
no_spaces_around_selected_binary_operators = false
space_between_ending_comma_and_closing_bracket = false
spaces_around_default_or_named_assign = false
spaces_around_power_operator = true
spaces_before_comment = 2
split_all_comma_separated_values = false
split_arguments_when_comma_terminated = false
split_before_bitwise_operator = true
split_before_closing_bracket = true
split_before_dict_set_generator = true
split_before_dot = false
split_before_expression_after_opening_paren = false
split_before_first_argument = false
split_before_logical_operator = true
split_before_named_assigns = true
split_complex_comprehension = false
split_penalty_after_opening_bracket = 30
split_penalty_after_unary_operator = 10000
split_penalty_before_if_expr = 0
split_penalty_bitwise_operator = 300
split_penalty_comprehension = 80
split_penalty_excess_character = 7000
split_penalty_for_added_line_split = 30
split_penalty_import_names = 0
split_penalty_logical_operator = 300
use_tabs = false

[tool.yapfignore]
ignore_patterns = [".venv/**", "node_modules/**"]
