Skip to content

Polish documentation for the queue module - #10888

Merged
bjorng merged 1 commit into
erlang:masterfrom
bjorng:bjorn/stdlib/queue-documentation
Mar 23, 2026
Merged

Polish documentation for the queue module#10888
bjorng merged 1 commit into
erlang:masterfrom
bjorng:bjorn/stdlib/queue-documentation

Conversation

@bjorng

@bjorng bjorng commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Ensure that the first sentence describing each function makes sense by itself when shown in the Summary part of the documentation.

Add examples for all functions. Ensure that the example don't show the internal representaion of queues.

While at it, get rid of old-style catch from the test sutie, remove comments for documented functions, remove out-commented code, and do some other minor clean ups.

@bjorng bjorng self-assigned this Mar 20, 2026
@bjorng bjorng added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Mar 20, 2026
@github-actions

github-actions Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files    100 suites   1h 10m 6s ⏱️
2 288 tests 2 236 ✅ 51 💤 1 ❌
2 707 runs  2 650 ✅ 56 💤 1 ❌

For more details on these failures, see this check.

Results for commit 1bf2114.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@garazdawi garazdawi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, just have some small suggestions.

Comment thread lib/stdlib/src/queue.erl Outdated
Comment thread lib/stdlib/test/queue_SUITE.erl Outdated
chk_tuple(QsA, QsB, T, X, Y, N+1).

doctests(_Config) ->
ct_doctest:module(queue, []).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
ct_doctest:module(queue, []).
ct_doctest:module(queue, [{skipped_blocks, 0}]).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That doesn't seem to have any effect. As far as I understand, skipped blocks are examples blocks with unnumbered prompts (i.e. > instead of 1). It doesn't count functions without examples.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it asserts that there are no untested blocks added in future updates to the docs. Making sure that we don't add any examples that should be tested that aren't because they are skipped. It is false by default, so we need to add it to all ct_doctest calls. I considered having 0 as the default, but decided against it as it would probably be surprising to most users.

We could also add an option that lists how many undocumented functions there are? Instead of returning it as a comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, it does complain if I add a block with an unnumbered prompt.

We could also add an option that lists how many undocumented functions there are?

Do you mean untested functions (functions without tested examples)? Yes, I would like that.

Comment thread lib/stdlib/src/queue.erl
RaimoNiskanen
RaimoNiskanen previously approved these changes Mar 20, 2026
@bjorng
bjorng force-pushed the bjorn/stdlib/queue-documentation branch from 22b55df to 576c295 Compare March 20, 2026 08:56
Ensure that the first sentence describing each function makes sense
by itself when shown in the Summary part of the documentation.

Add examples for all functions. Ensure that the example don't show
the internal representaion of queues.

While at it, get rid of old-style `catch` from the test sutie, remove
comments for documented functions, remove out-commented code, and do
some other minor clean ups.
@bjorng
bjorng force-pushed the bjorn/stdlib/queue-documentation branch from 576c295 to 1bf2114 Compare March 20, 2026 10:12
@RaimoNiskanen
RaimoNiskanen self-requested a review March 20, 2026 11:48
@bjorng
bjorng merged commit 51e7e98 into erlang:master Mar 23, 2026
25 of 27 checks passed
@bjorng
bjorng deleted the bjorn/stdlib/queue-documentation branch March 23, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants