-
Notifications
You must be signed in to change notification settings - Fork 64
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
Remove dependencies if not needed #138
Changes from 3 commits
bdcdab1
72a1da9
9a39bf2
9e8fa79
8b0daa2
76345bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{Deps0, Config0} = case lists:keytake(deps, 1, CONFIG) of | ||
false -> {[], CONFIG}; | ||
{value, {deps, D}, Cfg} -> {D, Cfg} | ||
end, | ||
|
||
Deps = case list_to_integer(erlang:system_info(otp_release)) of | ||
N when N >= 27 -> | ||
[]; | ||
N when N >= 21 -> | ||
[{jsx, "3.1.0"}]; | ||
_ -> | ||
[{jsx, "3.1.0"}, {rfc3339, "0.9.0"}] | ||
end, | ||
|
||
[{deps, Deps ++ Deps0} | Config0]. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
, public_key | ||
, ssl | ||
, inets | ||
, jsx | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: one can actually add .app.src.script, see https://rebar3.org/docs/configuration/config_script There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, but we don't actually need jsx here anyways, this list is for apps to be started, jsx is not an app but only code to be loaded, that rebar will put in the right path for the BEAM to load the code automatically There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's also for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely very good point I don't know how could I forget! Fixed! :) |
||
, rfc3339 | ||
]} | ||
, {env, [ {re_options, [unicode, ucp]} | ||
]} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ run(Options, [Schema|_] = Schemata, [JsonInstance|JsonInstances]) -> | |
undefined -> | ||
io:fwrite("~p\n\n", [Result]); | ||
true -> | ||
io:fwrite("~s\n\n", [jsx:encode(Result)]) | ||
io:fwrite("~s\n\n", [?JSON:encode(Result)]) | ||
end, | ||
case JesseResult of | ||
{ok, _} -> | ||
|
@@ -90,7 +90,7 @@ jesse_run(JsonInstance, Schema, Schemata) -> | |
{ok, _} = application:ensure_all_started(jesse), | ||
ok = add_schemata(Schemata), | ||
{ok, JsonInstanceBinary} = file:read_file(JsonInstance), | ||
JsonInstanceJsx = jsx:decode(JsonInstanceBinary, [{return_maps, false}]), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be an ok change, and I don't have all the details in my head at this very moment, but why did you decide to remove return_maps=false ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since there's the "no macros in dynamic calls" to fix (see the CI run), and I guess the solution will be to create a function for encapsulation, maybe we just keep the return_maps=false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed it because That CI error, huh, elvis. Will fix 👌🏽 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed a fix :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, made a typo on the fix, pushed again 😅 |
||
JsonInstanceJsx = ?JSON:decode(JsonInstanceBinary), | ||
jesse:validate( Schema | ||
, JsonInstanceJsx | ||
). | ||
|
@@ -99,7 +99,7 @@ add_schemata([]) -> | |
ok; | ||
add_schemata([SchemaFile|Rest]) -> | ||
{ok, SchemaBin} = file:read_file(SchemaFile), | ||
Schema0 = jsx:decode(SchemaBin, [{return_maps, false}]), | ||
Schema0 = ?JSON:decode(SchemaBin), | ||
Schema = maybe_fill_schema_id(SchemaFile, Schema0), | ||
ok = jesse:add_schema(SchemaFile, Schema), | ||
add_schemata(Rest). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.