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

Standardize templates indentation #2884

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/rebar/priv/templates/app_rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{deps, []}.

{shell, [
% {config, "config/sys.config"},
%% {config, "config/sys.config"},
{apps, [{{name}}]}
]}.
12 changes: 6 additions & 6 deletions apps/rebar/priv/templates/escript_rebar.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{erl_opts, [no_debug_info]}.
{deps, []}.

{escript_incl_apps,
[{{name}}]}.
{escript_incl_apps, [{{name}}]}.
{escript_main_app, {{name}}}.
{escript_name, {{name}}}.
{escript_emu_args, "%%! +sbtu +A1\n"}.

%% Profiles
{profiles, [{test,
[{erl_opts, [debug_info]}
]}]}.
{profiles, [
{test, [
{erl_opts, [debug_info]}
]}
]}.
27 changes: 13 additions & 14 deletions apps/rebar/priv/templates/otp_app.app.src
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{{=@@ @@=}}
{application, @@name@@,
[{description, "@@desc@@"},
{vsn, "0.1.0"},
{registered, []},
{mod, {@@name@@_app, []}},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},

{licenses, ["Apache-2.0"]},
{links, []}
{application, @@name@@, [
{description, "@@desc@@"},
{vsn, "0.1.0"},
{registered, []},
{mod, {@@name@@_app, []}},
{applications, [
kernel,
stdlib
]},
{env, []},
{modules, []},
{licenses, ["Apache-2.0"]},
{links, []}
]}.
25 changes: 12 additions & 13 deletions apps/rebar/priv/templates/otp_lib.app.src
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{application, {{name}},
[{description, "{{desc}}"},
{vsn, "0.1.0"},
{registered, []},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},

{licenses, ["Apache-2.0"]},
{links, []}
{application, {{name}}, [
{description, "{{desc}}"},
{vsn, "0.1.0"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{env, []},
{modules, []},
{licenses, ["Apache-2.0"]},
{links, []}
]}.
16 changes: 8 additions & 8 deletions apps/rebar/priv/templates/provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
Provider = providers:create([
{name, ?PROVIDER}, % The 'user friendly' name of the task
{module, ?MODULE}, % The module implementation of the task
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 {{name}}"}, % How to use the plugin
{opts, []}, % list of options understood by the plugin
{short_desc, "{{desc}}"},
{desc, "{{desc}}"}
{name, ?PROVIDER}, % The 'user friendly' name of the task
{module, ?MODULE}, % The module implementation of the task
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 {{name}}"}, % How to use the plugin
{opts, []}, % list of options understood by the plugin
{short_desc, "{{desc}}"},
{desc, "{{desc}}"}
]),
{ok, rebar_state:add_provider(State, Provider)}.

Expand Down
51 changes: 28 additions & 23 deletions apps/rebar/priv/templates/relx_rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,37 @@
{erl_opts, [debug_info]}.
{deps, []}.

{relx, [{release, {@@name@@, "0.1.0"},
[@@name@@,
sasl]},
{relx, [
{release, {@@name@@, "0.1.0"}, [
@@name@@,
sasl
]},

{mode, dev},
{mode, dev},

%% automatically picked up if the files
%% exist but can be set manually, which
%% is required if the names aren't exactly
%% sys.config and vm.args
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"}
%% automatically picked up if the files
%% exist but can be set manually, which
%% is required if the names aren't exactly
%% sys.config and vm.args
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"}

%% the .src form of the configuration files do
%% not require setting RELX_REPLACE_OS_VARS
%% {sys_config_src, "./config/sys.config.src"},
%% {vm_args_src, "./config/vm.args.src"}
%% the .src form of the configuration files do
%% not require setting RELX_REPLACE_OS_VARS
%% {sys_config_src, "./config/sys.config.src"},
%% {vm_args_src, "./config/vm.args.src"}
]}.

{profiles, [{prod, [{relx,
[%% prod is the default mode when prod
%% profile is used, so does not have
%% to be explicitly included like this
{mode, prod}
{profiles, [
%% prod is the default mode when prod
%% profile is used, so does not have
%% to be explicitly included like this
{prod, [
{relx, [
{mode, prod}

%% use minimal mode to exclude ERTS
%% {mode, minimal}
]
}]}]}.
%% use minimal mode to exclude ERTS
%% {mode, minimal}
]}
]}
]}.
8 changes: 5 additions & 3 deletions apps/rebar/priv/templates/sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ start_link() ->
%% type => worker(), % optional
%% modules => modules()} % optional
init([]) ->
SupFlags = #{strategy => one_for_all,
intensity => 0,
period => 1},
SupFlags = #{
strategy => one_for_all,
intensity => 0,
period => 1
},
ChildSpecs = [],
{ok, {SupFlags, ChildSpecs}}.

Expand Down
Loading