[docstring] Ensure that all functions, fields, and constants have docstrings + Eliminate mojo doc warnings#194
Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving generated documentation by adding/expanding docstrings across the TOML tokenizer/parser and the numeric types (BigInt/BigUInt/BigDecimal/Decimal128/etc.), with the goal of eliminating mojo doc warnings.
Changes:
- Added docstrings for structs, fields, constants, and many methods across the codebase.
- Standardized docstring sections (Args/Returns/Parameters) in multiple modules.
- Removed an unused error-message header constant from
errors.mojo.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/decimo/toml/tokenizer.mojo | Adds docstrings for tokenizer constants, structs, and public methods. |
| src/decimo/toml/parser.mojo | Adds docstrings for TOML value/document/parser APIs. |
| src/decimo/tests.mojo | Adds docstrings for test/benchmark helper structs and parsing helper. |
| src/decimo/str.mojo | Expands docstrings for rjust/ljust. |
| src/decimo/rounding_mode.mojo | Documents rounding mode constants and methods. |
| src/decimo/errors.mojo | Adds field/method docstrings; removes unused header constant. |
| src/decimo/decimal128/utility.mojo | Expands docstring for number_of_bits. |
| src/decimo/decimal128/decimal128.mojo | Adds extensive docstrings across Decimal128 API and operators. |
| src/decimo/decimal128/constants.mojo | Adds docstrings for Decimal128 constant constructors. |
| src/decimo/biguint/exponential.mojo | Adds Args/Returns to sqrt_initial_guess docstring. |
| src/decimo/biguint/biguint.mojo | Adds docstrings across BigUInt constants/operators/helpers. |
| src/decimo/biguint/arithmetics.mojo | Adds Args/Returns sections to multiple arithmetic helpers. |
| src/decimo/bigint10/bigint10.mojo | Improves docstrings for fields, constructors, operators, and writers. |
| src/decimo/bigint/bitwise.mojo | Adds Args/Returns docstrings for bitwise operations. |
| src/decimo/bigint/bigint.mojo | Adds docstrings for constructors/operators/number-theory helpers. |
| src/decimo/bigint/arithmetics.mojo | Adds docs for tuning constants and refines a parameter description. |
| src/decimo/bigfloat/bigfloat.mojo | Adds/relocates docstrings for constants, fields, and methods. |
| src/decimo/bigdecimal/trigonometric.mojo | Adds Args/Returns to arctan docstring. |
| src/decimo/bigdecimal/rounding.mojo | Adds Returns section to round docstring. |
| src/decimo/bigdecimal/constants.mojo | Adds Args/Returns for pi and Chudnovsky helpers; documents Rational fields. |
| src/decimo/bigdecimal/comparison.mojo | Adds Args/Returns across comparison helpers. |
| src/decimo/bigdecimal/bigdecimal.mojo | Adds extensive docstrings across BigDecimal constructors/operators/math methods. |
Comments suppressed due to low confidence (1)
src/decimo/decimal128/utility.mojo:576
- Spelling in error message:
intergralshould beintegral(this string may surface in diagnostics).
"""
comptime assert dtype.is_integral(), "must be intergral"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mojo doc warningsmojo doc warnings
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.
This PR focuses on improving generated documentation by adding/expanding docstrings across the TOML tokenizer/parser and the numeric types (BigInt/BigUInt/BigDecimal/Decimal128/etc.), with the goal of eliminating
mojo docwarnings.Changes:
errors.mojo.