Skip to content

Fix typos across the codebase#1076

Open
anuragagrawal17 wants to merge 2 commits into
openzim:mainfrom
anuragagrawal17:fix-typos
Open

Fix typos across the codebase#1076
anuragagrawal17 wants to merge 2 commits into
openzim:mainfrom
anuragagrawal17:fix-typos

Conversation

@anuragagrawal17
Copy link
Copy Markdown

No description provided.

@kelson42 kelson42 requested review from Copilot and kelson42 May 3, 2026 05:54
@kelson42 kelson42 added this to the 9.7.0 milestone May 3, 2026
@kelson42 kelson42 changed the title fix typos across the codebase Fix typos across the codebase May 3, 2026
Copy link
Copy Markdown
Contributor

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.90%. Comparing base (dde6c50) to head (7f7d2b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1076   +/-   ##
=======================================
  Coverage   55.90%   55.90%           
=======================================
  Files          99       99           
  Lines        5023     5023           
  Branches     2236     2236           
=======================================
  Hits         2808     2808           
  Misses        733      733           
  Partials     1482     1482           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a broad typo/documentation cleanup across tests, internal implementation comments, and public headers. It fits into the codebase as a non-functional maintenance pass intended to improve readability and developer-facing API documentation.

Changes:

  • Correct spelling mistakes in test comments and assertions.
  • Fix typos in internal source comments and developer notes.
  • Clean up wording in public header documentation for archive, search, suggestion, item, entry, and blob APIs.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/tooltesting.cpp Fixes a typo in a test comment about batch boundaries.
test/suggestion.cpp Corrects wording in a compatibility-related test comment.
test/search.cpp Corrects the same compatibility comment in search tests.
test/find.cpp Fixes a typo in a binary-search test comment.
test/error_in_creator.cpp Cleans up spelling in asynchronous error-handling test comments.
test/cluster.cpp Fixes a typo in an architecture-related test comment.
test/archive.cpp Updates misspelled nonexistent-path strings and nearby comments in archive tests.
src/writer/workers.cpp Corrects a typo in a worker shutdown comment.
src/writer/defaultIndexData.h Fixes spelling in initialization comments.
src/writer/cluster.cpp Cleans up compression/write-path comments.
src/suggestion.cpp Corrects BM25 documentation wording.
src/search_internal.h Fixes a typo in suggestion-mode commentary.
src/reader.h Corrects a typo in a read helper comment.
src/narrowdown.h Cleans up spelling in class-level and sorting comments.
src/lrucache.h Fixes copyright/documentation typos in the cache header.
src/fileimpl.cpp Corrects several tolerance/resource-related comment typos.
src/dirent.cpp Fixes spelling in buffer-sizing comments.
src/compression.h Cleans up typoed decompression comments.
src/cluster.cpp Fixes concurrency-related comment wording.
src/archive.cpp Corrects a typo in explanatory archive comments.
include/zim/suggestion.h Improves public API documentation spelling for suggestion search.
include/zim/search_iterator.h Fixes iterator doc typos and grammar.
include/zim/search.h Cleans up public search API documentation wording.
include/zim/item.h Corrects item API doc comments.
include/zim/entry.h Fixes a typo in entry redirection documentation.
include/zim/blob.h Corrects constructor documentation spelling.
include/zim/archive.h Cleans up archive API documentation wording and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/error_in_creator.cpp
Comment on lines +337 to 339
// Too long and all tests will wait to much and developers hate to wait
// Not enough and error is not detected and tests fail (and developers hate failing tets)
// The exacte value is specific to each computer, so we need to make this configurable.
Comment thread include/zim/suggestion.h
*
* A SuggestionSearcher is mainly used to create new `SuggestionSearch`
* Internaly, this is a wrapper around a SuggestionDataBase with may or may not
* Internally, this is a wrapper around a SuggestionDataBase with may or may not
Comment thread include/zim/item.h
*
* It can be usefull as an optimisation when interacting with other system
* It can be useful as an optimisation when interacting with other system
* by reopeing the file and reading the content bypassing the libzim.
Comment thread src/cluster.cpp
// Note:
// - No need to protect this method from concurent access (as well
// - No need to protect this method from concurrent access (as well
// as memoize its result) as it is intended to be called by ConcurentCache
Comment thread test/archive.cpp
ASSERT_THROW(archive.getEntryByPath("non/existant/path"), zim::EntryNotFound);
ASSERT_THROW(archive.getEntryByPath("C/non/existant/path"), zim::EntryNotFound);
ASSERT_THROW(archive.getEntryByPathWithNamespace('C', "non/existant/path"), zim::EntryNotFound);
// NO existent entries
Comment thread src/search_internal.h
Comment thread test/error_in_creator.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/error_in_creator.cpp
Comment on lines +337 to 339
// Too long and all tests will wait to much and developers hate to wait
// Not enough and error is not detected and tests fail (and developers hate failing tets)
// The exacte value is specific to each computer, so we need to make this configurable.
Comment thread include/zim/suggestion.h
*
* A SuggestionSearcher is mainly used to create new `SuggestionSearch`
* Internaly, this is a wrapper around a SuggestionDataBase with may or may not
* Internally, this is a wrapper around a SuggestionDataBase with may or may not
Comment thread src/search_internal.h

// If the database is open for suggestion.
// True even if the dabase has no newSuggestionformat.
// True even if the database has no newSuggestionformat.
Comment thread test/archive.cpp
ASSERT_THROW(archive.getEntryByPath("non/existant/path"), zim::EntryNotFound);
ASSERT_THROW(archive.getEntryByPath("C/non/existant/path"), zim::EntryNotFound);
ASSERT_THROW(archive.getEntryByPathWithNamespace('C', "non/existant/path"), zim::EntryNotFound);
// NO existent entries
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/zim/search.h
/** Get a set of results for this search.
*
* @param start The begining of the range to get
* @param start The beginning of the range to get
Comment thread include/zim/archive.h
/** Return a list of available sizes (width) for the illustrations in the archive.
*
* Illustration is an icon for the archive that can be used in catalog and elsewehere to illustrate the archive.
* Illustration is an icon for the archive that can be used in catalog and elsewhere to illustrate the archive.
Comment thread include/zim/entry.h
*
* If there is a chain of redirection, the whole chain is resolved
* and the item associted to the last entry is returned.
* and the item associated to the last entry is returned.
Comment thread include/zim/item.h
* Get the data of the item, starting at offset.
*
* @param offset The number of byte to skip at begining of the data.
* @param offset The number of byte to skip at beginning of the data.
Comment thread include/zim/archive.h
* - User entries are always stored without namespace.
* (For information, they are stored in the same namespace `C`. Still consider there is no namespace as all API masks it)
* As there is no namespace, paths don't contain it: `foo.hmtl`, `image.png`, ...
* As there is no namespace, paths don't contain it: `foo.html`, `image.png`, ...
Comment thread include/zim/search.h
* You can search for articles in a certain distance of a point.
*
* @param latitude The latitute of the point.
* @param latitude The latitude of the point.
Comment thread include/zim/suggestion.h
*
* A SuggestionSearcher is mainly used to create new `SuggestionSearch`
* Internaly, this is a wrapper around a SuggestionDataBase with may or may not
* Internally, this is a wrapper around a SuggestionDataBase with may or may not
Comment thread src/search_internal.h

// If the database is open for suggestion.
// True even if the dabase has no newSuggestionformat.
// True even if the database has no newSuggestionformat.
Comment thread include/zim/item.h
Comment thread include/zim/item.h
* and at which to read to get the data.
*
* It can be usefull as an optimisation when interacting with other system
* It can be useful as an optimisation when interacting with other system
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 17 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/zim/item.h
* Get the `size` bytes of data of the item, starting at offset.
*
* @param offset The number of byte to skip at begining of the data.
* @param offset The number of byte to skip at beginning of the data.
Comment thread include/zim/entry.h
*
* If there is a chain of redirection, the whole chain is resolved
* and the item associted to the last entry is returned.
* and the item associated to the last entry is returned.
Comment thread include/zim/search.h
* You can search for articles in a certain distance of a point.
*
* @param latitude The latitute of the point.
* @param latitude The latitude of the point.
Comment thread include/zim/item.h
*
* It can be usefull as an optimisation when interacting with other system
* It can be useful as an optimisation when interacting with other system
* by reopeing the file and reading the content bypassing the libzim.
Comment thread test/error_in_creator.cpp
@@ -304,8 +304,8 @@ TEST_P(FaultyDelayedItemErrorTest, faultyCompressedItem)
CHECK_ASYNC_EXCEPT(creator.addMetadata("A metadata", "A compressed (default) metadata"));
// give a chance to threads to detect the error.
// How many time to wait is a bit tricky.
Comment thread include/zim/archive.h
Comment on lines +459 to +461
* It is inferred from the internal way the entry are stored.
*
* This method is probably not relevent and is provided for completeness.
* This method is probably not relevant and is provided for completeness.
Comment thread include/zim/item.h
* Get the data of the item, starting at offset.
*
* @param offset The number of byte to skip at begining of the data.
* @param offset The number of byte to skip at beginning of the data.
Comment thread include/zim/suggestion.h
*
* A SuggestionSearcher is mainly used to create new `SuggestionSearch`
* Internaly, this is a wrapper around a SuggestionDataBase with may or may not
* Internally, this is a wrapper around a SuggestionDataBase with may or may not
Comment thread include/zim/archive.h
Comment on lines 378 to 379
* An Archive may contains several illustrations with different size.
* This method allows to know which illustration are in the archive (by size: width)
Comment thread include/zim/archive.h
/** Get a random entry.
*
* The entry is picked randomly from the front artice list.
* The entry is picked randomly from the front article list.
@kelson42 kelson42 modified the milestones: 9.7.0, 9.8.0 May 9, 2026
@kelson42
Copy link
Copy Markdown
Contributor

kelson42 commented May 9, 2026

@anuragagrawal17 Copilot has reported a lot of new typos, and this is the right moment to fix them. Therefore I pospone this PR to the next milestone, so we can fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants