fix(zim): correct config_indexing docstring to full-text only#297
Draft
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Draft
fix(zim): correct config_indexing docstring to full-text only#297Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Conversation
The docstring of Creator.config_indexing claimed it toggled both full-text and title indexing, but libzim only toggles the full-text index; the title index is always built. Update the docstring to reflect libzim's actual behaviour and add a regression test.
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.
Closes #294
Repo
openzim/python-scraperlib
Issue
#294
Root cause
The docstring of
Creator.config_indexinginsrc/zimscraperlib/zim/creator.pystated it toggled "full-text and title indexing of entries". In reality, libzim'sconfig_indexingonly toggles the full-text index; the title index is always built. The python-scraperlib documentation was therefore misleading.Fix
Updated the docstring of
Creator.config_indexingto state it toggles full-text indexing only and added an explicit note that title indexing is always performed by libzim and cannot be disabled via this method.Regression test
tests/zim/test_zim_creator.py::test_config_indexing_docstring_only_mentions_full_textasserts the docstring contains "full-text" and does NOT contain the misleading phrase "full-text and title indexing".Risk
trivial
Verification
Local pytest plugin environment was broken (missing
textualmodule unrelated to this repo). Verified the fix via AST inspection of the updated source: the docstring contains "full-text" and no longer contains "full-text and title indexing" — matching the regression test's assertions. Result: PASS.