diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c6ca79..c166bfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: id: setup-beam with: otp-version: ${{matrix.otp_vsn}} - rebar3-version: '3' + rebar3-version: '3.20' - name: Restore _build uses: actions/cache@v3 with: @@ -41,21 +41,13 @@ jobs: -rebar3-${{steps.setup-beam.outputs.rebar3-version}}\ -hash-${{hashFiles('rebar.lock')}}" - name: Compile - env: - ERL_FLAGS: "-enable-feature all" run: rebar3 compile - name: Format check if: ${{ matrix.os == 'ubuntu-20.04' }} - env: - ERL_FLAGS: "-enable-feature all" run: rebar3 format --verify - name: Run test - env: - ERL_FLAGS: "-enable-feature all" run: rebar3 test - name: Run elvis on elvis - env: - ERL_FLAGS: "-enable-feature all" run: | rebar3 escriptize _build/default/bin/elvis_core diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4d1e94e..0c7ecd0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,16 +16,15 @@ jobs: with: globs: | LICENSE - CONTRIBUTING.md - MIGRATION.md - README.md - RULES.md + *.md doc_rules/**/*.md - .github/ISSUE_TEMPLATE/*.md + .github/**/*.md - name: yamllint uses: ibiqlik/action-yamllint@v3 with: - file_or_dir: .github/workflows/*.yml + file_or_dir: | + .github/**/*.yml + .*.yml strict: true config_file: .yamllint.yml diff --git a/.markdownlint.yml b/.markdownlint.yml index 77ddc06..90b8143 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -1,3 +1,4 @@ +--- default: true MD013: line_length: 100 diff --git a/.yamllint.yml b/.yamllint.yml index d0e5475..26633db 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,3 +1,4 @@ +--- extends: default rules: line-length: diff --git a/CHANGELOG.md b/CHANGELOG.md index 773fbfa..0e9709f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ + # Changelog +For more recent releases check the [Releases](../../releases) page. + ## [1.3.1](https://github.com/inaka/elvis_core/tree/1.3.1) (2021-10-18) [Full Changelog](https://github.com/inaka/elvis_core/compare/1.3.0...1.3.1) @@ -436,6 +439,4 @@ - Copy in the elvis files [\#2](https://github.com/inaka/elvis_core/pull/2) ([Licenser](https://github.com/Licenser)) - Update LICENSE [\#1](https://github.com/inaka/elvis_core/pull/1) ([elbrujohalcon](https://github.com/elbrujohalcon)) - - \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/rebar.config b/rebar.config index f8b4347..7edcc8c 100644 --- a/rebar.config +++ b/rebar.config @@ -4,23 +4,7 @@ %% == Erlang Compiler == %% Erlang compiler options -{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, - warn_missing_spec, - warn_untyped_record, - debug_info, - {feature, maybe_expr, enable}]}. +{erl_opts, [debug_info, warn_export_vars, warn_missing_spec, warn_unused_import]}. {profiles, [{test, @@ -39,7 +23,7 @@ %% == Dependencies == -{deps, [{zipper, "1.0.1"}, {katana_code, "~> 2.0.1"}]}. +{deps, [{zipper, "1.0.1"}, {katana_code, "~> 2.0.2"}]}. %% == Dialyzer == diff --git a/rebar.lock b/rebar.lock index 1b01df0..0333726 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,11 +1,11 @@ {"1.2.0", -[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.0.1">>},0}, +[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.0.2">>},0}, {<<"zipper">>,{pkg,<<"zipper">>,<<"1.0.1">>},0}]}. [ {pkg_hash,[ - {<<"katana_code">>, <<"E29D82DBCF410FD29665B3FD2C9D9C445F1E8FAC4B01488294ECAA84CCB8400C">>}, + {<<"katana_code">>, <<"FAC8F2ABFB2ED54304EE44EEEEC30275BD026550533D094265A51927D7D9470D">>}, {<<"zipper">>, <<"3CCB4F14B97C06B2749B93D8B6C204A1ECB6FAFC6050CACC3B93B9870C05952A">>}]}, {pkg_hash_ext,[ - {<<"katana_code">>, <<"D02F757C8DDE643614D508474A97FC24D9015FE375477E34DE26450BF21CAC16">>}, + {<<"katana_code">>, <<"3E57FED635E0B16A5FBDACCDC872EC53DEB21ED9FC6E7EB9B6415FF199B7B138">>}, {<<"zipper">>, <<"6A1FD3E1F0CC1D1DF5642C9A0CE2178036411B0A5C9642851D1DA276BD737C2D">>}]} ]. diff --git a/src/elvis_core.erl b/src/elvis_core.erl index f293762..85876fe 100644 --- a/src/elvis_core.erl +++ b/src/elvis_core.erl @@ -83,7 +83,8 @@ rock_this(Path, Config) -> %% @private -spec do_parallel_rock(elvis_config:config()) -> - ok | {fail, [elvis_result:file() | elvis_result:rule()]}. + ok | + {fail, [{throw, term()} | elvis_result:file() | elvis_result:rule()]}. do_parallel_rock(Config0) -> Parallel = elvis_config:from_application_or_config(parallel, 1), Config = elvis_config:resolve_files(Config0), diff --git a/test/examples/fail_used_ignored_variable.erl b/test/examples/fail_used_ignored_variable.erl index f7b3077..d5dabb0 100644 --- a/test/examples/fail_used_ignored_variable.erl +++ b/test/examples/fail_used_ignored_variable.erl @@ -1,5 +1,11 @@ -module(fail_used_ignored_variable). +-if(?OTP_RELEASE >= 25). + +-feature(maybe_expr, enable). + +-endif. + -export([ use_ignored_var/2 , use_ignored_var_in_fun/2 , no_used_ignored_vars_here/2, handle_call/3 diff --git a/test/style_SUITE.erl b/test/style_SUITE.erl index e89b302..d93ebd6 100644 --- a/test/style_SUITE.erl +++ b/test/style_SUITE.erl @@ -629,7 +629,7 @@ verify_used_ignored_variable(Config) -> [#{line_num := _}, #{line_num := _}, #{line_num := _}, #{line_num := _}] = elvis_core_apply_rule(Config, elvis_style, used_ignored_variable, #{}, Path); erl_files -> - [#{line_num := 25}, #{line_num := 28}, #{line_num := 32}, #{line_num := 32}] = + [#{line_num := 31}, #{line_num := 34}, #{line_num := 38}, #{line_num := 38}] = elvis_core_apply_rule(Config, elvis_style, used_ignored_variable, #{}, Path) end, [] =