Skip to content

Commit

Permalink
Clean up @see and {@link foo/1} edoc usage
Browse files Browse the repository at this point in the history
EDoc doesn't seem to like the `{@see foo/1}` syntax within a larger `@doc`.
I've only gotten `@see` to work as the first bit of a comment line:

```erlang
%% @doc foo bar baz
%% @see foo/1
```

Many of the inline uses I was able to simply change to use `{@link
foo/2}`.

Edoc now successfully completes with no errors or warnings.
  • Loading branch information
reiddraper committed Aug 6, 2014
1 parent 8653419 commit 97d70ad
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
22 changes: 11 additions & 11 deletions src/riak_core_bucket_type.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
%% 2. When the creation has propogated to all nodes, the type may be activated.
%% As the activation propogates, nodes will be able to use the type
%%
%% The first step is performed using {@see create/2}. The second by
%% {@see activate/1}. After the type has been activated, some
%% properties may be updated using {@see update/2}. All operations are
%% The first step is performed using {@link create/2}. The second by
%% {@link activate/1}. After the type has been activated, some
%% properties may be updated using {@link update/2}. All operations are
%% serialized through {@link riak_core_claimant} except reading bucket
%% type properties with {@get/1}.
%% type properties with {@link get/1}.
%%
%% Bucket types can be in one of four states. The
%% state of a type can be queried using {@see status/1}.
%% state of a type can be queried using {@link status/1}.
%%
%% 1. undefined - the type has not been created
%% 2. created - the type has been created but has not propogated to all nodes
Expand All @@ -65,21 +65,21 @@
%% {@link riak_core_claimant} to a new node -- ensuring concurrent
%% updates do not break the invariant.
%%
%% * calling {@see create/1} multiple times before a Bucket Type
%% * calling {@link create/1} multiple times before a Bucket Type
%% is active is allowed. The newer creation will supersede any
%% previous ones. In addition, the type will be "claimed" by the
%% {@link riak_core_claimant} node writing the property. Future
%% calls to {@see create/1} must be serialized through the same
%% calls to {@link create/1} must be serialized through the same
%% claimant node or the call will not succeed. In the case where
%% the claimed type fails to propogate to a new claimant during a
%% a failure the potential concurrent update is resolved with
%% last-write-wins. Since nodes can not use inactive types, this is
%% safe.
%% * A type may only be activated if it is in the `ready' state. This means
%% all nodes must be reachable from the claimant
%% * {@see create/1} will fail if the type is active. Activation concurrent
%% * {@link create/1} will fail if the type is active. Activation concurrent
%% with creation is not possible due to the previous restriction
%% * {@see update/1} will fail unless the type is updated. {@see update/1} does
%% * {@link update/1} will fail unless the type is updated. {@link update/1} does
%% not allow modifications to properties for which the invariant must hold
%% (NOTE: this is up to the implementor of the riak_core bucket_validator).
%%
Expand Down Expand Up @@ -145,7 +145,7 @@ defaults() ->
%% function may be called arbitratily many times if the claimant does not change between
%% calls and the type is not active. An error will also be returned if the properties
%% are not valid. Properties not provided will be taken from those returned by
%% {@see defaults/0}.
%% @see defaults/0.
-spec create(bucket_type(), bucket_type_props()) -> ok | {error, term()}.
create(?DEFAULT_TYPE, _Props) ->
{error, default_type};
Expand Down Expand Up @@ -186,7 +186,7 @@ get(BucketType) when is_binary(BucketType) ->
riak_core_claimant:get_bucket_type(BucketType, undefined).

%% @doc Reset the properties of the bucket. This only affects properties that
%% can be set using {@see update/2} and can only be performed on an active
%% can be set using {@link update/2} and can only be performed on an active
%% type.
-spec reset(bucket_type()) -> ok | {error, term()}.
reset(BucketType) ->
Expand Down
10 changes: 5 additions & 5 deletions src/riak_core_claimant.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,19 @@ clear() ->
ring_changed(Node, Ring) ->
internal_ring_changed(Node, Ring).

%% @doc {@see riak_core_bucket_type:create/2}
%% @see riak_core_bucket_type:create/2
-spec create_bucket_type(riak_core_bucket_type:bucket_type(), [{atom(), any()}]) ->
ok | {error, term()}.
create_bucket_type(BucketType, Props) ->
gen_server:call(claimant(), {create_bucket_type, BucketType, Props}, infinity).

%% @doc {@see riak_core_bucket_type:status/1}
%% @see riak_core_bucket_type:status/1
-spec bucket_type_status(riak_core_bucket_type:bucket_type()) ->
undefined | created | ready | active.
bucket_type_status(BucketType) ->
gen_server:call(claimant(), {bucket_type_status, BucketType}, infinity).

%% @doc {@see riak_core_bucket_type:activate/1}
%% @see riak_core_bucket_type:activate/1
-spec activate_bucket_type(riak_core_bucket_type:bucket_type()) ->
ok | {error, undefined | not_ready}.
activate_bucket_type(BucketType) ->
Expand Down Expand Up @@ -206,13 +206,13 @@ get_bucket_type(BucketType, Default, RequireActive) ->
Props -> maybe_filter_inactive_type(RequireActive, Default, Props)
end.

%% @doc {@see riak_core_bucket_type:update/2}
%% @see riak_core_bucket_type:update/2
-spec update_bucket_type(riak_core_bucket_type:bucket_type(), [{atom(), any()}]) ->
ok | {error, term()}.
update_bucket_type(BucketType, Props) ->
gen_server:call(claimant(), {update_bucket_type, BucketType, Props}).

%% @doc {@see riak_core_bucket_type:iterator/0}
%% @see riak_core_bucket_type:iterator/0
-spec bucket_type_iterator() -> riak_core_metadata:iterator().
bucket_type_iterator() ->
riak_core_metadata:iterator(?BUCKET_TYPE_PREFIX, [{default, undefined},
Expand Down
2 changes: 1 addition & 1 deletion src/riak_core_metadata_exchange_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ merge(Peer, PKey, LocalObj) ->
riak_core_metadata_manager:merge(Peer, {PKey, undefined}, LocalObj).


%% @privarte
%% @private
repair_iterator(local, _, Prefix) when is_atom(Prefix) orelse is_binary(Prefix) ->
riak_core_metadata_manager:iterator(Prefix);
repair_iterator(local, _, Prefix) when is_tuple(Prefix) ->
Expand Down
11 changes: 7 additions & 4 deletions src/riak_core_metadata_hashtree.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ key_hashes(Node, Prefixes, Segment) ->
gen_server:call({?SERVER, Node}, {key_hashes, Prefixes, Segment}, infinity).

%% @doc Locks the tree on this node for updating on behalf of the
%% calling process. {@see lock/2}
%% calling process.
%% @see lock/2
-spec lock() -> ok | not_built | locked.
lock() ->
lock(node()).

%% @doc Locks the tree on `Node' for updating on behalf of the calling
%% process. {@see lock/2}.
%% process.
%% @see lock/2
-spec lock(node()) -> ok | not_built | locked.
lock(Node) ->
lock(Node, self()).
Expand All @@ -128,7 +130,8 @@ lock(Node) ->
lock(Node, Pid) ->
gen_server:call({?SERVER, Node}, {lock, Pid}, infinity).

%% @doc Updates the tree on this node. {@see update/1}.
%% @doc Updates the tree on this node.
%% @see update/1
-spec update() -> ok | not_locked | not_built | ongoing_update.
update() ->
update(node()).
Expand All @@ -154,7 +157,7 @@ update(Node) ->
%% found between the two trees. `HandlerAcc' is passed to the first
%% invocation of `HandlerFun'. Subsequent calls are passed the return
%% value from the previous call. This function returns the return
%% value from the last call to `HandlerFun'. {@see hashtree_tree} for
%% value from the last call to `HandlerFun'. {@link hashtree_tree} for
%% more details on `RemoteFun', `HandlerFun' and `HandlerAcc'.
-spec compare(hashtree_tree:remote_fun(), hashtree_tree:handler_fun(X), X) -> X.
compare(RemoteFun, HandlerFun, HandlerAcc) ->
Expand Down
2 changes: 1 addition & 1 deletion src/riak_core_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ replace_file(FN, Data) ->
{error, Err}
end.

%% @doc Similar to {@link file:read_file} but uses raw file I/O
%% @doc Similar to {@link file:read_file/1} but uses raw file `I/O'
read_file(FName) ->
{ok, FD} = file:open(FName, [read, raw, binary]),
IOList = read_file(FD, []),
Expand Down
4 changes: 3 additions & 1 deletion src/vclock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ descends(Va, Vb) ->
%% at least that of the given `dot()'. False otherwise. Call with a
%% valid entry or you'll get an error.
%%
%% @see descends/2, get_entry/3, dominates/2
%% @see descends/2
%% @see get_entry/3
%% @see dominates/2
-spec descends_dot(vclock(), dot()) -> boolean().
descends_dot(Vclock, Dot) ->
descends(Vclock, [Dot]).
Expand Down

5 comments on commit 97d70ad

@borshop
Copy link
Contributor

@borshop borshop commented on 97d70ad Aug 6, 2014

Choose a reason for hiding this comment

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

saw approval from andrewjstone
at 97d70ad

@borshop
Copy link
Contributor

@borshop borshop commented on 97d70ad Aug 6, 2014

Choose a reason for hiding this comment

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

merging basho/riak_core/feature/edoc-cleanup = 97d70ad into borshop-integration-620-feature/edoc-cleanup

@borshop
Copy link
Contributor

@borshop borshop commented on 97d70ad Aug 6, 2014

Choose a reason for hiding this comment

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

basho/riak_core/feature/edoc-cleanup = 97d70ad merged ok, testing candidate = d8b80ee

@borshop
Copy link
Contributor

@borshop borshop commented on 97d70ad Aug 6, 2014

Choose a reason for hiding this comment

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

@borshop
Copy link
Contributor

@borshop borshop commented on 97d70ad Aug 6, 2014

Choose a reason for hiding this comment

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

fast-forwarding develop to borshop-integration-620-feature/edoc-cleanup = d8b80ee

Please sign in to comment.