From 01d66b49596b1f1e9c6b04100e8e51393a07f5ab Mon Sep 17 00:00:00 2001 From: Fernando 'Brujo' Benavides Date: Mon, 9 May 2011 15:33:23 -0300 Subject: [PATCH 1/4] fixed hrl paths --- rebar.config | 2 ++ src/jsx.erl | 2 +- src/jsx_eep0018.erl | 2 +- src/jsx_format.erl | 4 ++-- src/jsx_utf16.erl | 4 ++-- src/jsx_utf16le.erl | 4 ++-- src/jsx_utf32.erl | 4 ++-- src/jsx_utf32le.erl | 4 ++-- src/jsx_utf8.erl | 4 ++-- src/jsx_verify.erl | 2 +- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/rebar.config b/rebar.config index 72fd678..a7e1b04 100644 --- a/rebar.config +++ b/rebar.config @@ -4,3 +4,5 @@ %% uncomment to get verbose output from test suite %% {eunit_opts, [verbose]}. + +{erl_opts, [{i, "src"}, {src_dirs, ["src"]}]}. \ No newline at end of file diff --git a/src/jsx.erl b/src/jsx.erl index 0f54758..203175d 100644 --- a/src/jsx.erl +++ b/src/jsx.erl @@ -33,7 +33,7 @@ -export([format/1, format/2]). --include("./include/jsx_common.hrl"). +-include("jsx_common.hrl"). -ifdef(TEST). diff --git a/src/jsx_eep0018.erl b/src/jsx_eep0018.erl index e2b6e93..ee56d71 100644 --- a/src/jsx_eep0018.erl +++ b/src/jsx_eep0018.erl @@ -28,7 +28,7 @@ -export([json_to_term/2, term_to_json/2]). --include("./include/jsx_common.hrl"). +-include("jsx_common.hrl"). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). diff --git a/src/jsx_format.erl b/src/jsx_format.erl index d20cf1b..170d4e9 100644 --- a/src/jsx_format.erl +++ b/src/jsx_format.erl @@ -28,8 +28,8 @@ -export([format/2]). --include("./include/jsx_common.hrl"). --include("./include/jsx_format.hrl"). +-include("jsx_common.hrl"). +-include("jsx_format.hrl"). -ifdef(TEST). diff --git a/src/jsx_utf16.erl b/src/jsx_utf16.erl index 7c84293..bb6c87f 100644 --- a/src/jsx_utf16.erl +++ b/src/jsx_utf16.erl @@ -26,8 +26,8 @@ -define(utf16, true). --include("./include/jsx_common.hrl"). --include("./include/jsx_decoder.hrl"). +-include("jsx_common.hrl"). +-include("jsx_decoder.hrl"). %% i've noticed you've noticed that there's no source here. very astute. see %% jsx_decoder_template.hrl in the include directory. any mofications to this diff --git a/src/jsx_utf16le.erl b/src/jsx_utf16le.erl index 2133c86..db5606d 100644 --- a/src/jsx_utf16le.erl +++ b/src/jsx_utf16le.erl @@ -26,8 +26,8 @@ -define(utf16le, true). --include("./include/jsx_common.hrl"). --include("./include/jsx_decoder.hrl"). +-include("jsx_common.hrl"). +-include("jsx_decoder.hrl"). %% i've noticed you've noticed that there's no source here. very astute. see %% jsx_decoder_template.hrl in the include directory. any mofications to this diff --git a/src/jsx_utf32.erl b/src/jsx_utf32.erl index 87c7337..a7e7d98 100644 --- a/src/jsx_utf32.erl +++ b/src/jsx_utf32.erl @@ -26,8 +26,8 @@ -define(utf32, true). --include("./include/jsx_common.hrl"). --include("./include/jsx_decoder.hrl"). +-include("jsx_common.hrl"). +-include("jsx_decoder.hrl"). %% i've noticed you've noticed that there's no source here. very astute. see %% jsx_decoder_template.hrl in the include directory. any mofications to this diff --git a/src/jsx_utf32le.erl b/src/jsx_utf32le.erl index fd85926..ba76a32 100644 --- a/src/jsx_utf32le.erl +++ b/src/jsx_utf32le.erl @@ -26,8 +26,8 @@ -define(utf32le, true). --include("./include/jsx_common.hrl"). --include("./include/jsx_decoder.hrl"). +-include("jsx_common.hrl"). +-include("jsx_decoder.hrl"). %% i've noticed you've noticed that there's no source here. very astute. see %% jsx_decoder_template.hrl in the include directory. any mofications to this diff --git a/src/jsx_utf8.erl b/src/jsx_utf8.erl index dbe844f..53b48fe 100644 --- a/src/jsx_utf8.erl +++ b/src/jsx_utf8.erl @@ -26,8 +26,8 @@ -define(utf8, true). --include("./include/jsx_common.hrl"). --include("./include/jsx_decoder.hrl"). +-include("jsx_common.hrl"). +-include("jsx_decoder.hrl"). %% i've noticed you've noticed that there's no source here. very astute. see %% jsx_decoder_template.hrl in the include directory. any mofications to this diff --git a/src/jsx_verify.erl b/src/jsx_verify.erl index dd8daa0..6979329 100644 --- a/src/jsx_verify.erl +++ b/src/jsx_verify.erl @@ -28,7 +28,7 @@ -export([is_json/2]). --include("./include/jsx_common.hrl"). +-include("jsx_common.hrl"). -ifdef(TEST). From 85ffad2081f33e63cc88272a2f8e5c0dce97fd85 Mon Sep 17 00:00:00 2001 From: Fernando 'Brujo' Benavides Date: Mon, 9 May 2011 15:34:51 -0300 Subject: [PATCH 2/4] Ignoring compiled files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..678b670 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +ebin/ +deps/ +*.orig From 252b9b695c95b3a8ab57899fd42388c8867a207c Mon Sep 17 00:00:00 2001 From: Fernando 'Brujo' Benavides Date: Mon, 9 May 2011 15:45:20 -0300 Subject: [PATCH 3/4] A convenient set of rebar options added to rebar.config --- rebar.config | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index a7e1b04..2c26a72 100644 --- a/rebar.config +++ b/rebar.config @@ -5,4 +5,19 @@ %% uncomment to get verbose output from test suite %% {eunit_opts, [verbose]}. -{erl_opts, [{i, "src"}, {src_dirs, ["src"]}]}. \ No newline at end of file +{erl_opts, [{i, "src"}, {src_dirs, ["src"]}, + warn_unused_vars, + warn_export_all, + warn_shadow_vars, + warn_unused_import, + warn_unused_function, + warn_bif_clash, + warn_unused_record, + warn_deprecated_function, + warn_obsolete_guard, + strict_validation, + warn_export_vars, + warn_exported_vars, + debug_info]}. +{dialyzer_opts, [{warnings, [unmatched_returns, error_handling, race_conditions, behaviours]}]}. +{xref_checks, [undefined_function_calls]}. From 7079a6ead758748b4d92074f28cfdab56ab48782 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Mon, 4 Jul 2011 21:07:50 -0700 Subject: [PATCH 4/4] whitespace fixes for contributed patch --- src/jsx.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jsx.erl b/src/jsx.erl index ecc0272..5c773a3 100644 --- a/src/jsx.erl +++ b/src/jsx.erl @@ -76,7 +76,7 @@ decoder(OptsList) -> json_to_term(JSON) -> try json_to_term(JSON, []) %% rethrow exception so internals aren't confusingly exposed to users - catch error:badarg -> erlang:error(badarg,[JSON]) + catch error:badarg -> erlang:error(badarg, [JSON]) end. @@ -91,7 +91,7 @@ json_to_term(JSON, Opts) -> term_to_json(JSON) -> try term_to_json(JSON, []) %% rethrow exception so internals aren't confusingly exposed to users - catch error:badarg -> erlang:error(badarg,[JSON]) + catch error:badarg -> erlang:error(badarg, [JSON]) end. @@ -100,7 +100,7 @@ term_to_json(JSON) -> term_to_json(JSON, Opts) -> try jsx_eep0018:term_to_json(JSON, Opts) %% rethrow exception so internals aren't confusingly exposed to users - catch error:badarg -> erlang:error(badarg,[JSON,Opts]) + catch error:badarg -> erlang:error(badarg, [JSON, Opts]) end. @@ -275,4 +275,4 @@ multi_test_result() -> --endif. +-endif. \ No newline at end of file