Skip to content

Docs: smart_truncate empty-separator ValueError only on word-boundary path - #9

Open
lomeliDev wants to merge 1 commit into
masterfrom
issue/2-docs-smart-truncate-empty-separator-valueerror-only
Open

lomeliDev wants to merge 1 commit into
masterfrom
issue/2-docs-smart-truncate-empty-separator-valueerror-only

Conversation

@lomeliDev

Copy link
Copy Markdown
Owner

Summary

Issue #2: correct the smart_truncate documentation and pin its existing empty-separator behavior with a regression test.

The ValueError comes from str.split(''), reached on the word-boundary truncation path. The hard-cut path returns the truncated string. No runtime behavior changes.

Evidence

  • Red/green view: not applicable by design. This is a documentation correction plus coverage for behavior already present in the frozen implementation. The regression test is expected to pass with the existing production code; no production logic was changed.
  • Taller CI gate reproduced on CPython 3.11.2:
    • flake8 --ignore=E501,F403,F401,E241,E225,E128 --exclude=legacy_reference.py slugify setup.py tests tools — passed (exit 0).
    • pycodestyle --ignore=E128,E261,E225,E501,W605 --exclude=legacy_reference.py slugify tests setup.py tools — passed (exit 0).
    • .venv-issue2-ci/bin/python -m pytest tests — 134 passed in 0.62s.
  • Not reproduced: CPython 3.10, 3.12, 3.13, 3.14, and PyPy 3.11 are named in the repository workflows but are not installed in this workspace. The diff adds no new Python syntax; it changes documentation and uses a standard unittest assertion.
  • The diff is limited to the Issue's Archivos:: slugify/_legacy.py, README.md, and tests/test_release.py. No lockfiles or unrelated files are included.

🚀 Generated with Dojo ⛩️

@lomeliDev

Copy link
Copy Markdown
Owner Author

Revisión adversarial independiente — APROBABLE

Revisado por quien no escribió el código, worktree propio (origin/pr/9), import resuelto al worktree, Python 3.11.2.

Naturaleza: corrección de docstring + README + test de caracterización (sin cambio de lógica). La vista roja/verde no aplica por diseño, y así se declara correctamente.

Puerta fiel al CI (taller-ci.yml), reproducida:

flake8 ...  exit 0
pycodestyle ...  exit 0
python -m pytest -p no:cacheprovider tests -q  -> 134 passed, 5 skipped, 136 subtests passed   (base 133 + 1)

CI del fork verde en 3.11 y 3.12 (gh pr checks).

El contrato documentado coincide con el efecto real (verificado):

smart_truncate('a b c', 3, word_boundary=False, separator='')  -> 'a b'          (NO lanza)
smart_truncate('a b c', 3, word_boundary=True,  separator='')  -> ValueError: empty separator

El test nuevo fija ambas ramas, así que la doc no podrá volver a divergir en silencio. La corrección del docstring en _legacy.py es no-conductual (permitido); el README queda consistente.

Alcance: slugify/_legacy.py, README.md, tests/test_release.py — exactamente los Archivos: de la issue #2. Legacy no cambia de comportamiento.

Sin reparos.

— revisión adversarial automática, sesión Claude Code (independiente del autor).

@lomeliDev
lomeliDev force-pushed the issue/2-docs-smart-truncate-empty-separator-valueerror-only branch from 2c3f8aa to 91eae04 Compare October 14, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant