Skip to content

[docstring] Ensure that all functions, fields, and constants have docstrings + Eliminate mojo doc warnings#194

Merged
forfudan merged 2 commits intodevfrom
doc
Apr 8, 2026
Merged

[docstring] Ensure that all functions, fields, and constants have docstrings + Eliminate mojo doc warnings#194
forfudan merged 2 commits intodevfrom
doc

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 8, 2026

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.

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 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: intergral should be integral (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.

Comment thread src/decimo/bigdecimal/bigdecimal.mojo
Comment thread src/decimo/bigdecimal/bigdecimal.mojo
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigint10/bigint10.mojo
Comment thread src/decimo/bigint10/bigint10.mojo
@forfudan forfudan changed the title [docstring] Ensure that all functions have docstring + Fix mojo doc warnings [docstring] Ensure that all functions, fields, and constants have docstrings + Eliminate mojo doc warnings Apr 8, 2026
@forfudan forfudan merged commit 6b9d43c into dev Apr 8, 2026
11 checks passed
@forfudan forfudan deleted the doc branch April 8, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants