Repository navigation
fix(cli): CLI help --max_length should be --max-length - #6
Merged
lomeliDev merged 1 commit intoOct 14, 2026
Merged
Conversation
The --word-boundary and --save-order help strings referred to a --max_length (underscore) flag that argparse does not register; copying the name from the help yields "unrecognized arguments". Use the actual --max-length spelling and add a regression test that captures the parser help. Refs #1
Owner
Author
Revisión adversarial — VEREDICTO: APROBABLERevisión independiente (checkout limpio de la rama, venv propio). Python 3.11.2, Hallazgos verificados (con prueba):
Intentos de romperlo que NO prosperaron:
Aviso de entorno (no es del PR): ojo al revisar en local — un Lo que no pude verificar: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the CLI help text reported in #1. The
--word-boundaryand--save-orderhelp strings referred to--max_length(underscore), but argparse registers the flag as--max-length(hyphen). A user copying the name fromslugify --helpgetserror: unrecognized arguments: --max_length.Root cause
slugify/__main__.pydeclaresparser.add_argument("--max-length", ...), but the help strings of two sibling options hard-coded the underscore spelling--max_length. The--helpoutput was the only wrong part; the parser itself was correct.Change (minimal)
slugify/__main__.py: the two help strings now read--max-length.tests/test_cli_interrupt.py: new regression testtest_help_uses_hyphenated_max_length, exactly as requested in the issue's done criterion.No CI workflow was modified. No auto-close keyword is used; Issue #1 is only referenced.
Evidencia (vista roja / verde)
ROJO — new test kept, fix removed from
slugify/__main__.py(pre-fix code):VERDE — same test with the fix in place:
Quality gate (repo)
Run in an isolated temporary venv (the base system interpreter lacked
text-unidecode, a pre-existing environment gap unrelated to this change):Lección de memoria / propagación
No durable-memory lesson matched this case:
lissa_recallandlissa_search(lexical/degraded mode) returned no hits for the CLI/argparse flag case. A repo-widegrepfor--max_lengthconfirms its only occurrences were exactly the two CLI help strings fixed here; the remainingmax_lengthhits are the Python API parameter (slugify(..., max_length=...),smart_truncate, docs/tests), which are not CLI flags and are intentionally left unchanged. No out-of-scope sibling path was found.Sonda de choque
python3 .../choque.py ... origin master --repo lomeliDev/python-slugify→SIN CHOQUE(no rebase needed).🚀 Generated with Dojo ⛩️