noirbizarre/emotional

View on GitHub
pyproject.toml

Summary

Maintainability
Test Coverage
[project]
name = "emotional"
description = "A Commitizen plugin for conventional commit with emojis and integrations"
authors = [
    {name = "Axel H.", email = "noirbizarre@gmail.com"},
]
requires-python = ">=3.8.1"
dependencies = [
    "commitizen>=3.18.1",
    "typing-extensions>=4.4.0; python_version<'3.10'",
]
dynamic = ["version"]
readme = "README.md"
license = {text = "MIT"}

[project.urls]
Homepage = "https://github.com/noirbizarre/emotional"
Repository = "https://github.com/noirbizarre/emotional"
Issues = "https://github.com/noirbizarre/emotional/issues"

[project.entry-points."commitizen.plugin"]
emotional = "emotional.plugin:Emotional"


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

[tool.pdm.version]
source = "scm"
write_to = "emotional/VERSION"


[tool.pdm.dev-dependencies]
test = [
    "pytest>=7.1.2",
    "pytest-sugar>=0.9.5",
    "pytest-cov>=3.0.0",
    "syrupy>=4.0",
    "pytest-mock>=3.12.0",
]
lint = [
    "codespell>=2.2.6",
    "mypy>=1.7.0",
    "ruff>=0.3.0",
]


[tool.pdm.scripts]
test.help = "Run the test suite"
test.cmd = "pytest"

lint.help = "Lint all tracked files using pre-commit"
lint.cmd = "pre-commit run --all-files"

format.help = "Format the code according to known rules"
format.composite = [
    "codespell --write-changes --interactive 2",
    # See: https://docs.astral.sh/ruff/formatter/#sorting-imports
    "ruff check --select I --fix-only --show-fixes emotional tests",
    "ruff format emotional tests"
]

typing.help = "Full typing linting (includes imported packages and uncommmited files)"
typing.cmd = "mypy extensions tests --warn-unused-ignores"

cover.help = "Run the test suite with coverage"
pre_cover = "coverage erase"
cover.composite = [
  """
  test
    --cov-report=term
    --cov=emotional
    --cov-report=html:reports/coverage
    --cov-report=xml:reports/coverage.xml
    --no-cov-on-fail
    --junitxml=reports/tests.xml
  """
]

"cover:all".help = "Run the test suite against all supported Python version"
"pre_cover:all" = "coverage erase"
"cover:all".cmd = "tox --parallel"

check.help = "Check everything"
check.composite = [
  "echo '🚦 Tests & Coverage 📸'",
  "cover:all",
  "echo '\n🎨 Style'",
  "lint",
]

changelog.help = "Generate/update the changelog"
changelog.cmd = "cz changelog --incremental"

bump.help = "Bump the version using commitizen"
bump.cmd = "cz bump --changelog --check-consistency"


[tool.commitizen]
name = "emotional"
github = "noirbizarre/emotional"
version_provider = "scm"
order_by_scope = true
major_version_zero = true  # Remove this line for the first 1.x release


[tool.codespell]
ignore-words=".codespellignore"


[tool.pytest.ini_options]
addopts = "-ra"
norecursedirs = ".git build dist"
testpaths = [
  "emotional/",
  "tests/",
]
markers = [
  "settings: Provide key-value commitizen settings pair",
]


[tool.coverage.run]
source = ["emotional"]
branch = true
omit = [
  "tests/*",
]

[tool.coverage.report]
exclude_also = [
  'def __repr__',
  'if TYPE_CHECKING:',
]
ignore_errors = true


[tool.ruff]
line-length = 100
respect-gitignore = true
src = [".", "tests"]

[tool.ruff.lint]
select = [
    # Pyflakes
    "F",
    # Pycodestyle
    "E",
    "W",
    # McCabe # fake8-comprehension
    "C",
    # Pyupgrade
    "UP",
    # isort
    "I001"
]

[tool.ruff.lint.isort]
known-third-party = ["commitizen", "pytest"]
lines-between-types = 1

[tool.ruff.lint.per-file-ignores]
"emotional/defaults.py" = ["C408"]