Skip to content

Commit f7f9f33

Browse files
authored
Merge pull request #2972 from jessestimpson/docs-2025
Improve documentation
2 parents b62659b + 07c0dbd commit f7f9f33

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Rebar3 is an escript built around the concept of providers. Providers are the
7979
modules that do the work to fulfill a user's command. They are documented in
8080
[the official documentation website](http://www.rebar3.org/docs/plugins#section-provider-interface).
8181

82+
> [!NOTE]
83+
> The Rebar3 repository uses an [umbrella project structure](https://rebar3.org/docs/basic_usage/).
84+
> Paths shown here are relative to the directory `apps/rebar`.
85+
8286
Example provider:
8387

8488
```erlang
@@ -121,7 +125,7 @@ format_error(Reason) ->
121125
io_lib:format("~p", [Reason]).
122126
```
123127

124-
Providers are then listed in `rebar.app.src`, and can be called from
128+
Providers are then listed in `rebar.app.src.script`, and can be called from
125129
the command line or as a programmatical API.
126130

127131
All commands are therefore implemented in standalone modules. If you call
@@ -218,6 +222,7 @@ be any of:
218222
{ok, OKRes}
219223
{ok, OKRes, ProfilesUsed}
220224
{error, Reason}
225+
return
221226

222227
% where:
223228
ProfilesUsed :: string() % matching the profiles to validate (defaults to "*")

apps/rebar/test/rebar_test_utils.erl

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,19 @@ init_rebar_state(Config, Name) ->
3737
[{apps, AppsDir}, {checkouts, CheckoutsDir}, {state, State} | Config].
3838

3939
%% @doc Takes common test config, a rebar config ([] if empty), a command to
40-
%% run ("install_deps", "compile", etc.), and a list of expected applications
41-
%% and/or dependencies to be present, and verifies whether they are all in
42-
%% place.
40+
%% run ("install_deps", "compile", etc.), and the expected term to check.
41+
%%
42+
%% The expected term can be one of
43+
%%
44+
%% - `{ok, ExpectationList}`: The expectation list is matched in the manner
45+
%% described below, using "*" for the profile.
46+
%% - `{ok, ExpectationList, ProfileUsed}`: The expectation list is matched
47+
%% in the manner described below for the given profile.
48+
%% - `{error, Reason}`: We assert that the error matches the expected reason.
49+
%% - `return`: No assertion is made.
50+
%%
51+
%% The expectation list is a list of expected applications and/or dependencies
52+
%% to be present, and verifies whether they are all in place.
4353
%%
4454
%% The expectation list takes elements of the form:
4555
%% - `{app, Name :: string()}': checks that the app is properly built.
@@ -49,6 +59,7 @@ init_rebar_state(Config, Name) ->
4959
%% has been fetched, and that a given version has been chosen. Useful to
5060
%% test for conflict resolution. Also ignores the build status of the
5161
%% dependency.
62+
%% - See `CONTRIBUTING.md` for more.
5263
%%
5364
%% This function assumes `init_rebar_state/1-2' has run before, in order to
5465
%% fetch the `apps' and `state' values from the CT config.

bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ main(Args) ->
5252
%% Build rebar3 modules with compile:file
5353
bootstrap_rebar3(),
5454

55-
%% Build rebar.app from rebar.app.src
55+
%% Build rebar.app from rebar.app.src.script
5656
{ok, App} = rebar_app_info:new(rebar, "3.25.1", filename:absname("_build/default/lib/rebar/")),
5757
rebar_otp_app:compile(rebar_state:new(), App),
5858

0 commit comments

Comments
 (0)