Skip to content

Commit

Permalink
chore: modernise the repository a bit (#29)
Browse files Browse the repository at this point in the history
* Ease booting application for development

docker-compose and user.conf are added because
otherwise there's no support elements for the boot

* Pin specific versions and help Renovate

This way it's easier for us to reason on the updates
semantically.

* Ease moving toward rebar3

Check
https://erlangforums.com/t/what-is-the-best-way-to-deal-with-rebar-lock-files-of-dependencies/2826/15
on a discussion of the benefits of rebar.lock

* Remove useless warning: nowarn_shadow_vars

By default we wanna get warned about these

* Add a few "good practice" compiler warnings

As per https://github.com/kivra/erlang_template

* Approach rebar3: remove some defaults

* Remove xref_check: prefer defaults

The defaults cover a wider range of options

* Add `dialyzer` options

* xref: stop caring about "unused exports"

It's either this or flagging all "interface API" functions
as -ignore_xref, which is potentially more difficult to
maintain. Choices (?)

* Tweak test coverage

* Cleanup

Try to be consistent in whitespace

* Ease owner identification
  • Loading branch information
kivra-pauoli authored Sep 4, 2024
1 parent 9259f78 commit 3551262
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# the project is owned by the platform team
* @kivra/platform-team
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ doc
_build
*~
.vscode/
rebar.lock
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
riak:
image: basho/riak-kv:ubuntu-2.2.3
ports:
- 8081:8081
volumes:
- ./riak/user.conf:/etc/riak/user.conf
healthcheck:
test: riak-admin wait-for-service riak_kv
interval: 2s
timeout: 5s
retries: 10
43 changes: 29 additions & 14 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{lib_dirs, ["deps"]}.
{deps_dir, ["deps"]}.
{erl_opts, [ debug_info
, nowarn_shadow_vars
, warnings_as_errors
, {platform_define, "^[0-9]+", namespaced_types}
, {platform_define, "^18", deprecated_now}
, warn_export_vars
, warn_unused_import
, warn_keywords
]}.
{xref_checks, [undefined_function_calls]}.
{cover_enabled, true}.
{cover_print_enabled, true}.

{dialyzer, [
{plt_apps, all_deps},
incremental,
{warnings, [unmatched_returns]}
]}.

{profiles, [
{test, [
{cover_enabled, true},
{cover_opts, [verbose]}
]}
]}.

{deps,
[ { stdlib2
, ""
, {git, "git@github.com:kivra/stdlib2.git", {branch, "master"}}
}
, { riakc
, ""
, {git, "git@github.com:kivra/riak-erlang-client.git", {tag, "2.5.4"}}
}
[ { stdlib2, {git, "git@github.com:kivra/stdlib2.git", {tag, "v1.4.6"}} }
, { riakc, {git, "git@github.com:kivra/riak-erlang-client.git", {tag, "2.5.4"}} }

%% Metrics
, { telemetry, "~> 1.2" }
Expand All @@ -35,3 +40,13 @@
]},
{override, hamcrest, [ {plugins, []} ]}
]}.

{shell, [{apps, [krc]}]}.

{xref_checks, [
undefined_function_calls,
undefined_functions,
locals_not_used,
deprecated_function_calls,
deprecated_functions
]}.
30 changes: 30 additions & 0 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{"1.2.0",
[{<<"hamcrest">>,
{git,"https://github.com/basho/hamcrest-erlang.git",
{ref,"ad3dbab419762fc2d5821abb88b989da006b85c6"}},
2},
{<<"prometheus">>,{pkg,<<"prometheus">>,<<"4.10.0">>},0},
{<<"quantile_estimator">>,{pkg,<<"quantile_estimator">>,<<"0.2.1">>},1},
{<<"riak_pb">>,
{git,"https://github.com/basho/riak_pb",
{ref,"08771aba2ce4935b715d32d1b92555efdc3da994"}},
1},
{<<"riakc">>,
{git,"git@github.com:kivra/riak-erlang-client.git",
{ref,"675098b50052508ab7be09198b023a2648c061ee"}},
0},
{<<"stdlib2">>,
{git,"git@github.com:kivra/stdlib2.git",
{ref,"f5fdd13de0f02d7b1f9482133a7e4bf8cce14974"}},
0},
{<<"telemetry">>,{pkg,<<"telemetry">>,<<"1.3.0">>},0}]}.
[
{pkg_hash,[
{<<"prometheus">>, <<"792ADBF0130FF61B5FA8826F013772AF24B6E57B984445C8D602C8A0355704A1">>},
{<<"quantile_estimator">>, <<"EF50A361F11B5F26B5F16D0696E46A9E4661756492C981F7B2229EF42FF1CD15">>},
{<<"telemetry">>, <<"FEDEBBAE410D715CF8E7062C96A1EF32EC22E764197F70CDA73D82778D61E7A2">>}]},
{pkg_hash_ext,[
{<<"prometheus">>, <<"2A99BB6DCE85E238C7236FDE6B0064F9834DC420DDBD962AAC4EA2A3C3D59384">>},
{<<"quantile_estimator">>, <<"282A8A323CA2A845C9E6F787D166348F776C1D4A41EDE63046D72D422E3DA946">>},
{<<"telemetry">>, <<"7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6">>}]}
].
3 changes: 3 additions & 0 deletions riak/user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
storage_backend=memory
buckets.default.allow_mult=true
buckets.default.last_write_wins=false

0 comments on commit 3551262

Please sign in to comment.