Fix documentation grammar, types, signatures, and add missing docs#417
Conversation
- Fix subject-verb agreement: "compilers that supports" → "support" - Fix subject-verb agreement: "sources are possible" → "is possible" - Remove extra word: "to include specify" → "to specify" - Add missing preposition: "working MaxMind DB" → "working with MaxMind DB" - Fix possessive: "it's major version" → "its major version" - Remove duplicated article: "the the records" → "the records" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix section heading: MMDB_result_s → MMDB_entry_s (MMDB_result_s doesn't exist; the section describes MMDB_entry_s) - Fix field reference: data_type → type (the actual field in MMDB_entry_data_s is "type", not "data_type") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The documentation showed MMDB_s *const mmdb but the header declares const MMDB_s *const mmdb for these functions. Update both the SYNOPSIS and individual function sections for: - MMDB_lookup_string - MMDB_lookup_sockaddr - MMDB_read_node - MMDB_get_metadata_as_entry_data_list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The implementation (maxminddb.c) uses >= to check node_number against node_count, so passing a node_number equal to node_count is also an error. Update the documentation to say "greater than or equal to" instead of "greater than". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @oschwald, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the clarity, accuracy, and completeness of the project's documentation. It addresses numerous grammatical inconsistencies and typos, corrects outdated or incorrect API references, and ensures that function signatures in the documentation precisely match their C header definitions. Furthermore, it provides crucial new guidance on handling complex data structures like maps and arrays, making the library easier to understand and use for developers. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request focuses on improving the documentation by fixing grammar, typos, and incorrect type/field references, as well as updating function signatures to match the header files. The changes are well-executed and enhance the clarity and accuracy of the documentation. I've found one minor inaccuracy in the description of a function parameter and have provided a suggestion to correct it.
| The `start` parameter is an `MMDB_entry_s` value. In most cases this will come | ||
| from the `entry` field of the `MMDB_lookup_result_s` value returned by | ||
| `MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`. |
There was a problem hiding this comment.
The description of the start parameter is slightly inaccurate. The function signature int MMDB_get_entry_data_list(MMDB_entry_s *start, ...) shows that start is a pointer to an MMDB_entry_s struct, not the struct value itself. The documentation should reflect this to avoid confusion.
| The `start` parameter is an `MMDB_entry_s` value. In most cases this will come | |
| from the `entry` field of the `MMDB_lookup_result_s` value returned by | |
| `MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`. | |
| The `start` parameter is a pointer to an `MMDB_entry_s` struct. In most cases this will be a pointer to the `entry` field of the `MMDB_lookup_result_s` value returned by `MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`. |
Add an explicit description of the start parameter: it is an MMDB_entry_s value, typically obtained from the entry field of an MMDB_lookup_result_s returned by MMDB_lookup_string() or MMDB_lookup_sockaddr(). This mirrors the existing description for the data lookup functions. Relates to GitHub #145. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add documentation explaining how to access individual entries in maps and arrays: - In the Data Lookup Functions section, explain that multiple keys in the same map are accessed via separate calls with the full lookup path, and that MMDB_get_entry_data_list() is more efficient for retrieving all data from a complex structure. - In the MMDB_entry_data_s section, note that MAP and ARRAY types represent collections and explain how to access their items. Relates to GitHub #255. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5d1da71 to
5d22433
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaced by precious tidy with the clang-format command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reformat C and Markdown files to match precious configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add pipx:clang-format 21.1.8 to mise.toml so that both local dev and CI use the exact same clang-format binary. This avoids formatting differences between clang-format versions (e.g. v18 on Ubuntu 24.04 CI vs v20 locally). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reformat to match clang-format 21.1.8 output. The only change is indentation of preprocessor directives inside #ifdef/#ifndef blocks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
MMDB_result_s→MMDB_entry_s) and field reference (data_type→type)const MMDB_s *const mmdbqualifiers frommaxminddb.hforMMDB_lookup_string,MMDB_lookup_sockaddr,MMDB_read_node, andMMDB_get_metadata_as_entry_data_listMMDB_read_nodebounds check description to match>=implementationMMDB_get_entry_data_liststartparameter (relates to Improvement needed in libmaxminddb docs #145)MMDB_get_value()andMMDB_get_entry_data_list()(relates to Iterating over map or array returned with MMDB_get_value() #255)Test plan
make checkpasses (all 28 tests)🤖 Generated with Claude Code