From f1f54b7895912d914536a8bf912afd1a281019c5 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Thu, 10 Dec 2020 21:38:07 +0000 Subject: [PATCH 1/2] Replace Travis CI with GitHub Actions --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 20 -------------------- README.md | 2 +- 3 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7ef0cf73 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +--- +name: build +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + ci: + name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}} + runs-on: ${{matrix.os}} + container: + image: erlang:${{matrix.otp_vsn}} + strategy: + matrix: + otp_vsn: [19.3, 20.0, 21.3, 22.3, 23.1] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - run: | + rebar3 --version + erl -version + - run: rebar3 test + - run: | + rebar3 escriptize + _build/default/bin/elvis_core diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 373db949..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: erlang - -os: - - linux - -otp_release: - - 19.3 - - 20.3 - - 21.3 - - 22.3 - - 23.1 - -script: - - wget https://s3.amazonaws.com/rebar3/rebar3 - - chmod +x rebar3 - - ./rebar3 --version - - erl -version - - ./rebar3 test - - ./rebar3 escriptize - - _build/default/bin/elvis_core diff --git a/README.md b/README.md index d156bacf..583eebb4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# elvis-core [![Build Status](https://travis-ci.org/inaka/elvis_core.svg?branch=master)](https://travis-ci.org/inaka/elvis_core) [![Stories in Ready](https://badge.waffle.io/inaka/elvis.png?label=ready&title=Ready)](https://waffle.io/inaka/elvis) +# elvis-core [![Build Status](https://github.com/inaka/elvis_core/workflows/build/badge.svg)](https://github.com/inaka/elvis_core) [![Stories in Ready](https://badge.waffle.io/inaka/elvis.png?label=ready&title=Ready)](https://waffle.io/inaka/elvis) Erlang style reviewer core library. From fb1b69e3d7bcfd31c72c49a1f9b365bfc7867fd2 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Thu, 10 Dec 2020 21:40:12 +0000 Subject: [PATCH 2/2] Lint README --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 583eebb4..dedee29c 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ We have only presented results where all files were well-behaved (respect all the rules), so here's an example of how it looks when files break some of the rules: -``` +```erlang # ../../test/examples/fail_line_length.erl [FAIL] - line_length - Line 14 is too long: " io:format(\"This line is 81 characters long and should be detected, yeah!!!\").". @@ -166,13 +166,17 @@ also you like to use tabs instead of spaces, so you need to override `erl_files` #### Ignoring Modules You can also `ignore` modules at a _check level_ or at a _ruleset (group of checks) level_: + - at check level by setting the ignore parameter in the rule you want to skip, e.g: + ```erlang {elvis_style, no_debug_call, #{ignore => [elvis, elvis_utils]}} ``` + There we are telling elvis to **ignore** _elvis_ and _elvis_utils_ modules when running `no_debug_call` check. - at ruleset level by setting the **ignore** group level option for the group you want to skip, e.g: + ```erlang #{dirs => ["src"], filter => "*.erl", @@ -180,6 +184,7 @@ You can also `ignore` modules at a _check level_ or at a _ruleset (group of chec ignore => [module1, module4] } ``` + With this configuration, none of the checks for [erl_files](https://github.com/inaka/elvis_core/blob/master/src/elvis_rulesets.erl#L6-L34) would be applied to `module1.erl` and `module4.erl` files. ### Formating @@ -188,7 +193,7 @@ You can also `ignore` modules at a _check level_ or at a _ruleset (group of chec `plain` and `parsable`. The latter could be use for the automated parsing and has a format very close to dialyzer in a form `FILE:LINE:RULE:MESSAGE`: -``` +```erlang src/example.erl:1:god_modules:This module has too many functions (56). Consider breaking it into a number of modules. src/example_a.erl:341:no_debug_call:Remove the debug call to io:format/2 on line 341. src/example_a.erl:511:used_ignored_variable:Ignored variable is being used on line 511 and column 54.