Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more specs #8014

Closed
wants to merge 0 commits into from
Closed

add more specs #8014

wants to merge 0 commits into from

Conversation

dgud
Copy link
Contributor

@dgud dgud commented Jan 11, 2024

Add specs for more applications.

@dgud dgud self-assigned this Jan 11, 2024
@dgud dgud added the team:PS Assigned to OTP team PS label Jan 11, 2024
Copy link
Contributor

github-actions bot commented Jan 11, 2024

CT Test Results

  5 files   67 suites   31m 20s ⏱️
802 tests 652 ✅ 150 💤 0 ❌
859 runs  695 ✅ 164 💤 0 ❌

Results for commit d460406.

♻️ 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

@dgud dgud added the testing currently being tested, tag is used by OTP internal CI label Jan 11, 2024
@garazdawi garazdawi force-pushed the dgud/add-specs branch 5 times, most recently from 790aea0 to 6ff049d Compare January 12, 2024 11:59
@garazdawi
Copy link
Contributor

@github-actions disable-cache

@IngelaAndin IngelaAndin self-requested a review January 12, 2024 12:58
@garazdawi garazdawi force-pushed the dgud/add-specs branch 3 times, most recently from 6a1f4eb to 8d25910 Compare January 12, 2024 14:52
-spec save_event_file(CollectorPid, FileName, [Option]) -> ok | {error, term()} when
CollectorPid :: pid(),
FileName :: file:filename(),
Option :: existing | write | append | keep | clear.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the manual options in the old documentation had some structure (that may not be worth keeping) but that helped in understanding the current documentation. So maybe we need to updated the description if we want this spec and current description not confusing people.

Backward :: neg_integer() | '-infinity',
Fun :: fun((event(), Acc) -> NewAcc) | undefined,
Acc :: term(),
NewAcc :: term().
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to adopt the description to say equivalent to instead of short for to adhere to the rest of the documentation and make a link to iterate/5. I see that you only addressed the spec part in this PR so I do not know if your intention is to fix these kind of improvements in a second round after conversion?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a spec only update, the docs will have to be fixed in a future PR.

@@ -31,6 +31,10 @@

-include("../include/et.hrl").

Copy link
Contributor

Choose a reason for hiding this comment

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

In this module it would also be nice with links in the descriptions!

@@ -89,6 +89,10 @@
trace_me/5, phone_home/5, report_event/5
]).


Copy link
Contributor

Choose a reason for hiding this comment

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

This modules descriptions could also use links.

@@ -139,12 +164,17 @@ start(Options, GUI) ->
%% A filter_fun() takes an event record as sole argument
%% and returns false | true | {true, NewEvent}.
%%----------------------------------------------------------------------

-spec start_link(GUIorOptions) -> {ok, Viewer::pid()} | {error, term()} when
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep default as documented option? wx is only possibility now! Users guide still mentions GS, which it should not!

%% Optionally creates the Mnesia table Tab with suitable default values.
%% Returns ok or EXIT's
create_table(Tab) ->
Storage = mnesia:table_info(schema, storage_type),
create_table(Tab, [{Storage, [node()]}]).

-spec create_table(Tab :: atom(), Opt :: [{atom(), term()}]) -> ok.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these spec not refer to mensia module spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to export them for a module that should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are they not exported as they are input types of the mnesia module?

start() ->
start([]).


-spec start(Options) -> ok when
Copy link
Contributor

Choose a reason for hiding this comment

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

etop:help() I think creates the documentation that we would want here too!

@@ -30,6 +30,7 @@

-define(change_at_runtime_config,[lines,interval,sort,accumulate]).

-spec help() -> ok.
Copy link
Contributor

Choose a reason for hiding this comment

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

Description of this module refers to types without proper references that can link to actual description.

@dgud dgud closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:PS Assigned to OTP team PS 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