forked from altenmueller/geodata2
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RTI-7894] Move the project into rebar3 and use all the goodies that …
…come with it (#3) * Move the project into rebar3 and use all the goodies that come with it * Some formatting improvements
- Loading branch information
Brujo Benavides
authored
Apr 22, 2020
1 parent
a553c5d
commit 762ffcc
Showing
12 changed files
with
378 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
- label: 'Test Build' | ||
command: | ||
- if [ ! -z "$MERGE_BRANCH" ]; then git merge $MERGE_BRANCH -m "merging $MERGE_BRANCH"; fi | ||
- make test | ||
- curl https://rebar3.s3.amazonaws.com/rebar3 -o ./rebar3 | ||
- chmod +x rebar3 | ||
- aws s3 sync s3://adroll-misc/rtb/geodata2/ . --exclude "*" --include "*plt" --no-follow-symlinks | ||
- ./rebar3 test | ||
- aws s3 sync . s3://adroll-misc/rtb/geodata2/ --exclude "*" --include "*plt" --no-follow-symlinks | ||
agents: | ||
queue: 'rtb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
_build/ | ||
*~ | ||
/.eunit | ||
/_test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[ | ||
{ | ||
elvis, | ||
[ | ||
{config, | ||
[#{dirs => ["src"], | ||
filter => "*.erl", | ||
ruleset => erl_files, | ||
rules => [ | ||
{elvis_style, dont_repeat_yourself, #{min_complexity => 40}}, | ||
{elvis_style, line_length, #{limit => 150}}, | ||
{elvis_style, invalid_dynamic_call, #{ignore => [geodata2]}} | ||
] | ||
}, | ||
#{dirs => ["test"], | ||
filter => "*.erl", | ||
ruleset => erl_files, | ||
rules => [ | ||
{elvis_style, dont_repeat_yourself, #{min_complexity => 40}}, | ||
%% Variables in eunit macros are called, for instance, __V | ||
{elvis_style, variable_naming_convention, #{regex => "^_?_?([A-Z][0-9a-zA-Z]*)_?$"}} | ||
] | ||
}, | ||
#{dirs => ["."], | ||
filter => "elvis.config", | ||
ruleset => elvis_config | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
%%-define(BINARY_COPY(Val), Val) %% - faster, less memory while you don't reload files. If you do reload you can potentially prevent old binaries from getting garbage collected | ||
-define(BINARY_COPY(Val), binary:copy(Val)). %% bit slower, more memory, but allows garbage collecting old large binaries with ease | ||
|
||
-define(BINARY_COPY(Val), | ||
binary:copy(Val)). %% bit slower, more memory, but allows garbage collecting old large binaries with ease | ||
-define(IPV6, 6). | ||
-define(IPV4, 4). | ||
|
||
-define(GEODATA2_STATE_TID, geodata2_state). | ||
|
||
-record(meta, {descr, database_type, languages, timestamp, ip_version, record_size, node_count, vsn, whole, remdr, tree_size, data_start, v4_start}). | ||
|
||
-record(meta, | ||
{descr, | ||
database_type, | ||
languages, | ||
timestamp, | ||
ip_version, | ||
record_size, | ||
node_count, | ||
vsn, | ||
whole, | ||
remdr, | ||
tree_size, | ||
data_start, | ||
v4_start}). | ||
-record(geocity, {country, city, city_geoid, long, lat}). | ||
|
||
-type geocity() :: #geocity{}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,47 @@ | ||
% -*- mode: erlang -*- | ||
{clean_files, ["ebin/*.beam", "ebin/egeoip.app", "doc/", "_test"]}. | ||
{erl_opts, [debug_info]}. | ||
{erl_opts, [ | ||
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, | ||
warnings_as_errors | ||
]}. | ||
|
||
{cover_enabled, true}. | ||
{cover_opts, [verbose]}. | ||
{cover_print_enabled, true}. | ||
|
||
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}. | ||
{dialyzer_opts, [{plt, "_test/dialyzer_plt"}, src]}. | ||
|
||
{dialyzer, [ | ||
{warnings, [unknown, no_return, error_handling]}, | ||
{plt_apps, top_level_deps}, | ||
{plt_extra_apps, []}, | ||
{plt_location, local}, | ||
{base_plt_apps, [erts, stdlib, kernel]}, | ||
{base_plt_location, global} | ||
]}. | ||
|
||
{xref_checks,[ | ||
undefined_function_calls, | ||
locals_not_used, | ||
deprecated_function_calls, | ||
deprecated_functions | ||
]}. | ||
|
||
{alias, [{test, [format, lint, xref, dialyzer, eunit, cover]}]}. | ||
|
||
{format, [ | ||
{files, ["src/*.erl", "test/*.erl", "include/*.hrl"]} | ||
]}. | ||
|
||
{plugins, [rebar3_lint, rebar3_format]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
-module(geodata2_app). | ||
|
||
-behaviour(application). | ||
|
||
-export([start/2]). | ||
-export([stop/1]). | ||
|
||
start(_Type, _Args) -> | ||
geodata2_sup:start_link(). | ||
geodata2_sup:start_link(). | ||
|
||
stop(_State) -> | ||
ok. | ||
ok. |
Oops, something went wrong.