You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
std coverage: ulid and uuid docs, examples, tests - #3652
main is red on the "Std symbols have Persian names, tests and docs" check since #3649 and #3650 (97 new gaps, 5 stale baseline lines). This fixes it for real, without baselining the new symbols.
website ex. keys in en and fa for every ulid symbol and the uuid fields (ULID.time/hi/lo, Result., Generator., ERR_, ParseResult., UUID.hi/lo/to_str)
doc.UUID.to_str in en and fa
three new ulid examples (New, Bytes, Errors) and one uuid example (Buffer), en and fa, each with a checked .out
new tests tests/{en,fa}/stdlib/uuid_buffer for ToBuffer, FromBuffer and to_str
ToBuffer and FromBuffer ex keys now point at the new Buffer example
five baseline lines removed: pool ParallelFor, str Compare, time Duration.Cmp, NowMillis, NowNanos
Checked locally with a main-built compiler: salam run tools/salam/check-std-coverage-docs.salam now prints "214 packages, 20920 public symbols, 14439 known gaps" with no new gaps, and all new examples pass website/check-example.sh.
Example (encoding-uuid-Buffer):
uuid.ToBuffer(id, buf)
back := uuid.FromBuffer(buf)
println back.to_str() // f81d4fae-7dec-11d0-a765-00a0c91e6bf6
Summary by CodeRabbit
Documentation
Added English and Persian examples covering ULID creation, parsing, byte conversions, comparisons, and errors.
Expanded UUID documentation and examples for string formatting, buffer conversions, and UUID fields.
Tests
Added English and Persian test coverage for UUID buffer round-trips and comparisons.
No actionable comments were generated in the recent review.
Walkthrough
The pull request adds English and Persian UUID and ULID examples, updates standard-library documentation mappings, adds UUID buffer tests, and removes five Persian entries from the standard-library coverage baseline.
Changes: UUID and ULID examples
Layer / File(s)
Summary
ULID examples and documentation mappings website/content/{en,fa}/std-examples/encoding-ulid/*, website/content/{en,fa}/std/187-encoding-ulid.txt
Adds localized examples for ULID creation, errors, and byte conversions. The documentation maps ULID entities and fields to examples.
UUID buffer examples, tests, and mappings tests/{en,fa}/stdlib/uuid_buffer.salam, website/content/{en,fa}/std-examples/encoding-uuid/encoding-uuid-Buffer.salam, website/content/{en,fa}/std/186-encoding-uuid.txt
Adds localized UUID buffer round-trip examples and tests. Updates UUID documentation for to_str and mappings for buffer and parse entities.
SalamLang/Salam#3651: Updates documentation, examples, tests, and coverage-baseline entries for the same standard-library coverage check.
Suggested reviewers:bdadmehr0, erfangnu
Merge Risk: Minimal · up to 6ea77
This change adds UUID and ULID documentation examples, tests and coverage baseline cleanup. No behavioral risk to production code is evident, so it looks ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "std coverage: ulid and uuid docs, examples, tests" names the main change: ULID and UUID documentation, examples, and tests added to close std coverage gaps. The raw summary confirms new ULI…
Description check
The description follows the template's main sections. It explains the purpose (fixing the red 'Std symbols have Persian names, tests and docs' check without baselining new symbols) and lists the propo…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "std coverage: ulid and uuid docs, examples, tests" names the main change: ULID and UUID documentation, examples, and tests added to close std coverage gaps. The raw summary confirms new ULID and UUID examples, website doc keys, and uuid_buffer tests in both en and fa. The title omits the baseline removals, which is acceptable because it need not cover every detail.
Full details: Description check
Explanation
The description follows the template's main sections. It explains the purpose (fixing the red 'Std symbols have Persian names, tests and docs' check without baselining new symbols) and lists the proposed changes: website ex. keys, doc.UUID.to_str, three ULID examples and one UUID example in en and fa, new uuid_buffer tests, and five removed baseline lines. It includes local test evidence with the check command and an example. Missing items: the 'Related Issue' section does not reference an issue (it cites PRs #3649 and #3650 only in prose), and the checklist is not ticked. These gaps are non-critical, so the description is mostly complete.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
This pull request adds English and Persian stdlib coverage for encoding.uuid and encoding.ulid by introducing new tests, website examples with checked outputs, and updated doc/example key mappings, while also removing five stale baseline entries. The changes are focused and consistent across languages, and they align with the stated goal of resolving the std coverage docs gaps without adding new baselines. From the diff, the content appears coherent, but there is at least one convention issue in the added Salam sources that should be confirmed or fixed.
What changed
Added tests/en/stdlib/uuid_buffer.salam and tests/fa/stdlib/uuid_buffer.salam with matching .out files to exercise ToBuffer, FromBuffer, UUID.hi/lo, and to_str behavior.
Added new website examples for ULID (New, Bytes, Errors) and UUID (Buffer) in both English and Persian, each with .salam and .out files.
Updated website/content/{en,fa}/std/186-encoding-uuid.txt and 187-encoding-ulid.txt to document UUID.to_str and wire ex.* keys (including ToBuffer/FromBuffer, result/field symbols, and ULID generator/error symbols) to the new examples; removed five stale entries from tools/salam/std-coverage-docs-baseline.txt.
Review
tests/en/stdlib/uuid_buffer.salam:1, website/content/en/std-examples/encoding-ulid/encoding-ulid-New.salam:1, encoding-ulid-Bytes.salam:1, encoding-ulid-Errors.salam:1, website/content/en/std-examples/encoding-uuid/encoding-uuid-Buffer.salam:1: all added English Salam source files start with import rather than a language header, while the added Persian sources start with // زبان: فارسی. If the repository requires every source file to begin with // lang: en or // زبان: فارسی, these files should be updated for consistency and to satisfy that convention.
tools/salam/std-coverage-docs-baseline.txt: the removed entries (untested-fa|pool|ParallelFor, untested-fa|str|Compare, untested-fa|time|Duration.Cmp, untested-fa|time|NowMillis, untested-fa|time|NowNanos) are presented as stale gaps, but this diff does not show corresponding new tests/docs/examples for them. Can you confirm these are now covered elsewhere on main/in this branch state rather than simply unbaselined here?
Tests
The PR adds deterministic-looking .out fixtures alongside the new stdlib tests and website examples, which is appropriate for coverage and documentation checks.
No build or test run was performed as part of this review; the reported local check-std-coverage-docs.salam and website/check-example.sh results were not independently verified here.
Risks
If English Salam sources are expected to carry // lang: en, the new files could fail style/coverage/tooling checks that enforce file headers.
Incorrectly dropping baseline entries without actual coverage elsewhere would leave the std coverage check red; this depends on repository state outside what can be concluded from the diff alone.
⚠️This review was written automatically by an AI and may contain mistakes. It is a helper for maintainers, not a replacement for a human review: check the code yourself before merging.
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
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.
main is red on the "Std symbols have Persian names, tests and docs" check since #3649 and #3650 (97 new gaps, 5 stale baseline lines). This fixes it for real, without baselining the new symbols.
Checked locally with a main-built compiler:
salam run tools/salam/check-std-coverage-docs.salamnow prints "214 packages, 20920 public symbols, 14439 known gaps" with no new gaps, and all new examples pass website/check-example.sh.Example (encoding-uuid-Buffer):
Summary by CodeRabbit