Skip to content

Commit

Permalink
Add rebar3 formatting (#5)
Browse files Browse the repository at this point in the history
* Add rebar3 formatting

* Remove old way

* Remove lint warnings

* Actually verify the formatting on CI

* Remove support for OTP 20

* Revert indentation of long lists

* Moving comments until AdRoll/rebar3_format#83 is fixed
  • Loading branch information
Brujo Benavides authored Apr 16, 2020
1 parent 7078e2d commit 9129594
Show file tree
Hide file tree
Showing 13 changed files with 422 additions and 486 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os:
- linux

otp_release:
- 20.3
- 21.3

notifications:
Expand All @@ -15,6 +14,5 @@ script:
- export PATH=/home/travis/.cache/rebar3/bin:$PATH
- rebar3 --version
- erl -version
- rebar3 format --verify
- rebar3 test
- git --no-pager diff
- if [[ $(git --no-pager diff) ]]; then echo "Your code is not properly formatted, run rebar3 format on it"; exit 999; fi
9 changes: 2 additions & 7 deletions elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
filter => "*.erl",
ruleset => erl_files,
rules => [
{elvis_style, line_length, #{limit => 100}},
{elvis_style, line_length, #{limit => 120}},
{elvis_style, nesting_level, #{level => 4}},
%% the default rule included {right, ","} and not {right, "=>"} or {left, "=>"}
{
elvis_style,
operator_spaces,
#{rules => [{right, "++"}, {left, "++"}, {right, "=>"}, {left, "=>"}]}
}
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}}
]
},
#{dirs => ["."],
Expand Down
11 changes: 5 additions & 6 deletions include/erliam.hrl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-type aws_datetime() :: string(). % "YYYYMMDDTHHMMSSZ"
-type iso_datetime() :: string(). % "YYYY-MM-DDTHH:MM:SSZ"

-record(credentials, {
expiration :: undefined | iso_datetime(),
security_token :: undefined | string(), % required when using temporary credentials
secret_access_key :: string(),
access_key_id :: string()
}).
-record(credentials,
{expiration :: undefined | iso_datetime(),
security_token :: undefined | string(), % required when using temporary credentials
secret_access_key :: string(),
access_key_id :: string()}).
6 changes: 4 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
deprecated_functions
]}.

{alias, [{test, [xref, dialyzer, lint, eunit, cover]}]}.
{alias, [{test, [format, lint, xref, dialyzer, eunit, cover]}]}.

{plugins, [{rebar3_lint, "0.1.10"}]}.
{plugins, [rebar3_lint, rebar3_format]}.

{format, [{files, ["src/*.erl", "include/*.hrl"]}]}.
Loading

0 comments on commit 9129594

Please sign in to comment.