-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebar.config.script
More file actions
52 lines (47 loc) · 1.57 KB
/
Copy pathrebar.config.script
File metadata and controls
52 lines (47 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% vim: set ft=erlang:
begin
TakeOutProjPlugin
= fun (Name, Config) ->
{project_plugins, ProjPlugins}
= lists:keyfind(project_plugins, 1, Config),
{value, {_, Version}, RemainingProjPlugins}
= lists:keytake(Name, 1, ProjPlugins),
% logger:notice("Dropping proj plugin '~ts' ~ts", [Name, Version]),
_UpdatedConfig
= lists:keystore(project_plugins, 1, Config,
{project_plugins, RemainingProjPlugins})
end,
TakeOutElvis
= fun (Config) ->
TakeOutProjPlugin(rebar3_lint, Config)
end,
TakeOutErlFmt
= fun (Config) ->
TakeOutProjPlugin(erlfmt, Config)
end,
TakeOutHank
= fun (Config) ->
TakeOutProjPlugin(rebar3_hank, Config)
end,
OtpRelease = erlang:system_info(otp_release),
try list_to_integer(OtpRelease) of
IntRelease when IntRelease =< 25 ->
% Take dev helpers away as they're no longer compatible with OTP 25
TakeOutHank(TakeOutErlFmt(TakeOutElvis(CONFIG)));
%
IntRelease when IntRelease =< 26 ->
% -doc tags wreak havok
TakeOutErlFmt(CONFIG);
%
IntRelease when IntRelease >= 29 ->
% katana_code/hank bug on OTP 29
TakeOutHank(CONFIG);
%
_ ->
CONFIG
catch
error:badarg ->
logger:warning("Don't now how to compare to OTP release: ~tp", [OtpRelease]),
CONFIG
end
end.