[tool.poetry]
name = "nautobot-design-builder"
version = "2.3.0"
description = "Nautobot app that uses design templates to easily create data objects in Nautobot with minimal input from a user."
authors = ["Network to Code, LLC <opensource@networktocode.com>"]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://github.com/nautobot/nautobot-app-design-builder"
repository = "https://github.com/nautobot/nautobot-app-design-builder"
documentation = "https://docs.nautobot.com/projects/design-builder/en/latest/"
keywords = ["nautobot", "nautobot-app", "nautobot-plugin"]
classifiers = [
    "Intended Audience :: Developers",
    "Development Status :: 5 - Production/Stable",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
]
include = [
    # Poetry by default will exclude files that are in .gitignore
    { path = "nautobot_design_builder/static/nautobot_design_builder/docs/**/*", format = ["sdist", "wheel"] }
]
packages = [
    { include = "nautobot_design_builder" },
]

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
# Used for local development
nautobot = ">=2.4.20,<3.0.0"

[tool.poetry.group.dev.dependencies]
coverage = "*"
# Currently pinned to <6.0.0 due to https://github.com/django-commons/django-debug-toolbar/issues/2168
django-debug-toolbar = "<6.0.0"
invoke = "*"
ipython = "*"
pylint = "*"
pylint-django = ">=2.5.4"
pylint-nautobot = ">=0.3.1"
ruff = "0.5.5"
yamllint = "*"
toml = "*"
# Python implementation of markdownlint
pymarkdownlnt = "~0.9.30"
Markdown = "*"
towncrier = ">=23.6.0,<=24.8.0"
to-json-schema = "*"
jsonschema = "*"
djlint = ">=1.36.4,<2.0.0"
djhtml = ">=3.0.8,<4.0.0"
tomli = { version = "*", markers = "python_version < '3.11'" }  # tomli is included in the stdlib as of Python 3.11

# Local to this project
snakeviz = "^2.2.0"
nautobot-bgp-models = {git = "https://github.com/nautobot/nautobot-app-bgp-models.git", rev = "develop"}

[tool.poetry.group.docs.dependencies]
# Render custom markdown for version added/changed/remove notes
markdown-version-annotations = "1.0.1"
# Rendering docs to HTML
mkdocs = "1.6.0"
# Material for MkDocs theme
mkdocs-material = "9.5.32"
# Automatic documentation from sources, for MkDocs
mkdocstrings = "0.25.2"
mkdocstrings-python = "1.10.8"
mkdocs-autorefs = "1.2.0"
griffe = "1.1.1"

[tool.poetry.extras]
all = [
]

[tool.pylint.master]
# Include the pylint_django plugin to avoid spurious warnings about Django patterns
load-plugins="pylint_django, pylint_nautobot"
ignore=".venv"

[tool.pylint.basic]
# No docstrings required for private methods (Pylint default), or for test_ functions, or for inner Meta classes.
no-docstring-rgx="^(_|test_|Meta$)"

[tool.pylint.messages_control]
# Line length is enforced by Black, so pylint doesn't need to check it.
# Pylint and Black disagree about how to format multi-line arrays; Black wins.
disable = """,
    line-too-long,
    duplicate-code,
    too-many-lines,
    too-many-ancestors,
    too-many-statements,
    line-too-long,
    nb-replaced-site,
    nb-replaced-device-role,
    nb-code-location-changed,
    nb-code-location-changed-object,
    nb-use-fields-all,
    too-many-positional-arguments,
    nb-warn-dunder-filter-field,
    nb-no-search-function,
    nb-no-char-filter-q,
"""

[tool.pylint.miscellaneous]
# Don't flag TODO as a failure, let us commit with things that still need to be done in the code
notes = """,
    FIXME,
    XXX,
    """

[tool.ruff]
line-length = 120
target-version = "py38"

[tool.ruff.lint]
select = [
    "D",  # pydocstyle
    "F", "E", "W",  # flake8
    "S",  # bandit
    "I",  # isort
]
ignore = [
    "D106",  # Missing docstring in public nested class - We have Meta and _meta and other similar
             # classes all over the place, but docstrings here don't usually add much
    # warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
    "D203",  # 1 blank line required before class docstring

    # D212 is enabled by default in google convention, and complains if we have a docstring like:
    # """
    # My docstring is on the line after the opening quotes instead of on the same line as them.
    # """
    # We've discussed and concluded that we consider this to be a valid style choice.
    "D212",  # Multi-line docstring summary should start at the first line
    "D213",  # Multi-line docstring summary should start at the second line

    # Produces a lot of issues in the current codebase.
    "D401",  # First line of docstring should be in imperative mood
    "D407",  # Missing dashed underline after section
    "D416",  # Section name ends in colon
    "E501", # Line too long
]

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

[tool.ruff.lint.per-file-ignores]
"nautobot_design_builder/migrations/*" = [
    "D",
]
"nautobot_design_builder/tests/*" = [
    "D",
    "S"
]

[tool.coverage.run]
disable_warnings = ["already-imported"]
relative_files = true
omit = [
    # Skip Tests
    "*/tests/*",
]
include = [
    "nautobot_design_builder/*",
]

[tool.pymarkdown]
plugins.selectively_enable_rules = true
plugins.blanks-around-lists.enabled = true
plugins.list-anchored-indent.enabled = true
extensions.front-matter.enabled = true

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.towncrier]
package = "nautobot_design_builder"
directory = "changes"
filename = "docs/admin/release_notes/version_2.3.md"
template = "development/towncrier_template.j2"
start_string = "<!-- towncrier release notes start -->"
issue_format = "[#{issue}](https://github.com/nautobot/nautobot-app-design-builder/issues/{issue})"

[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "security"
name = "Security"
showcontent = true

[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true

[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true

[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true

[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true

[[tool.towncrier.type]]
directory = "dependencies"
name = "Dependencies"
showcontent = true

[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "housekeeping"
name = "Housekeeping"
showcontent = true

[tool.djlint]
ignore = "H005,H006,H008,H011,H012,H013,H014,H015,H016,H019,H020,H021,H022,H023,H025,H026,H030,H031,H037"
profile="django"
extend_exclude = "docs/,nautobot_design_builder/static/"
