Skip to content

Commit

Permalink
Print all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Jan 22, 2025
1 parent c674c51 commit b15ef2a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/scan-code.escript
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ reviewed() ->
<<"zlib">>, <<"lgpl-2.0-plus WITH wxwindows-exception-3.1">>,
<<"openssl-ssleay">>, <<"cc-by-sa-3.0">>, <<"cc-by-4.0">>, <<"dco-1.1">>, <<"fsf-ap">>,
<<"classpath-exception-2.0">>, <<"ietf-trust">>, <<"apache-2.0-or-lgpl-2.1-or-later">>,
<<"BSD-3-Clause OR GPL-2.0-only">> ].
<<"bsd-new OR gpl-2.0">> ].

not_approved() ->
[<<"gpl">>, <<"gpl-3.0-plus">>, <<"gpl-2.0">>, <<"gpl-1.0-plus">>, <<"unlicense">>,
Expand Down Expand Up @@ -147,7 +147,10 @@ execute(Command, Config) ->
maps:get(sarif, Config) =/= undefined andalso
sarif(maps:get(sarif, Config), Errors),

Errors =/= [] andalso erlang:raise(exit, Errors, []),
Errors =/= [] andalso begin
[io:format("~p~n", [Error]) || Error <- Errors],
erlang:raise(exit, Errors, [])
end,
ok.

compliance_check(Licenses) when is_list(Licenses) ->
Expand All @@ -156,7 +159,11 @@ compliance_check(Licenses) when is_list(Licenses) ->
CopyrightResult = check_copyright(Copyright),
LicenseResult = compliance_check(License),
R = lists:foldl(fun (ok, Acc0) -> Acc0;
({error, Msg}, Acc0) -> [{SPDX, Path, Msg} | Acc0]
({error, Msg}, Acc0) ->
[#{ license => License,
spdx => SPDX,
path => Path,
msg => Msg} | Acc0]
end, [], [CopyrightResult, LicenseResult]),
R ++ Acc
end, [], Licenses);
Expand Down

0 comments on commit b15ef2a

Please sign in to comment.