From d6deed35bc8f3b72bd1ebc8e69fdb8271974d578 Mon Sep 17 00:00:00 2001 From: Juan Facorro Date: Mon, 7 Sep 2015 12:30:58 -0300 Subject: [PATCH 1/2] [#271] Updated version in .app.src, improved code and modified test to check for #252 --- src/elvis.app.src | 2 +- src/elvis_config.erl | 8 ++------ test/elvis_SUITE.erl | 14 ++++++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/elvis.app.src b/src/elvis.app.src index be33066..4d2be51 100644 --- a/src/elvis.app.src +++ b/src/elvis.app.src @@ -2,7 +2,7 @@ application, elvis, [ {description, "Erlang Style Reviewer, inspired on HoundCI"}, - {vsn, "0.2.5"}, + {vsn, "0.2.6-alpha1"}, {applications, [kernel, stdlib, ibrowse, ssl, jiffy, lager, aleppo, zipper]}, {modules, [ diff --git a/src/elvis_config.erl b/src/elvis_config.erl index c54b124..ca6ac04 100644 --- a/src/elvis_config.erl +++ b/src/elvis_config.erl @@ -108,7 +108,7 @@ dirs(#{}) -> filter(_RuleGroup = #{filter := Filter}) -> Filter; filter(#{}) -> - undefined. + ?DEFAULT_FILTER. -spec files(config()) -> [string()]. files(_RuleGroup = #{files := Files}) -> @@ -130,14 +130,10 @@ rules(#{}) -> resolve_files(Config, Files) when is_list(Config) -> Fun = fun(RuleGroup) -> resolve_files(RuleGroup, Files) end, lists:map(Fun, Config); -resolve_files(RuleGroup = #{filter := Filter}, Files) -> +resolve_files(RuleGroup, Files) -> Filter = filter(RuleGroup), Dirs = dirs(RuleGroup), FilteredFiles = elvis_file:filter_files(Files, Dirs, Filter), - RuleGroup#{files => FilteredFiles}; -resolve_files(RuleGroup, Files) -> - Dirs = dirs(RuleGroup), - FilteredFiles = elvis_file:filter_files(Files, Dirs, ?DEFAULT_FILTER), RuleGroup#{files => FilteredFiles}. %% @doc Takes a configuration and finds all files according to its 'dirs' diff --git a/test/elvis_SUITE.erl b/test/elvis_SUITE.erl index 6429b42..3b37aa6 100644 --- a/test/elvis_SUITE.erl +++ b/test/elvis_SUITE.erl @@ -199,11 +199,17 @@ run_webhook(_Config) -> elvis:start(), meck:new(egithub, [passthrough]), - FakeFun1 = fun(_, _, _) -> {ok, []} end, + Files = [#{<<"filename">> => <<"test/examples/rebar.config.fail">>}], + FakeFun1 = fun(_, _, _) -> {ok, Files} end, meck:expect(egithub, pull_req_files, FakeFun1), - meck:expect(egithub, pull_req_comments, FakeFun1), - meck:expect(egithub, issue_comments, FakeFun1), - FakeFun2 = fun(_, _, _, _) -> {error, error} end, + + EmptyResultFun = fun(_, _, _) -> {ok, []} end, + meck:expect(egithub, pull_req_comments, EmptyResultFun), + meck:expect(egithub, issue_comments, EmptyResultFun), + + FakeFun2 = fun(_, _, _, "elvis.config") -> + {error, error} + end, meck:expect(egithub, file_content, FakeFun2), ok = elvis:webhook(Request) From 5f4c0ee7dba01d8fcc198ffa7d16cd69425d39e3 Mon Sep 17 00:00:00 2001 From: Juan Facorro Date: Mon, 7 Sep 2015 12:33:16 -0300 Subject: [PATCH 2/2] [#271] Updated changelog --- CHANGELOG.md | 60 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2f7edb..4a57604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [0.2.6-alpha1](https://github.com/inaka/elvis/tree/0.2.6-alpha1) (2015-09-07) + +[Full Changelog](https://github.com/inaka/elvis/compare/0.2.5...0.2.6-alpha1) + +**Fixed bugs:** + +- Incorrect matching of files [\#252](https://github.com/inaka/elvis/issues/252) + +**Merged pull requests:** + +- \[Closes \#252\] Incorrect matching of files [\#268](https://github.com/inaka/elvis/pull/268) ([jfacorro](https://github.com/jfacorro)) + ## [0.2.5](https://github.com/inaka/elvis/tree/0.2.5) (2015-08-31) [Full Changelog](https://github.com/inaka/elvis/compare/0.2.5-beta4...0.2.5) @@ -10,20 +22,44 @@ - Options for max\_module\_length [\#261](https://github.com/inaka/elvis/issues/261) +- Improve git\_for\_deps\_erlang\_mk and git\_for\_deps\_rebar [\#199](https://github.com/inaka/elvis/issues/199) + +- Add --version option [\#174](https://github.com/inaka/elvis/issues/174) + +- Add an elvis:rock\_this/1 function to rock specific modules [\#159](https://github.com/inaka/elvis/issues/159) + **Fixed bugs:** - Possible false positive? [\#236](https://github.com/inaka/elvis/issues/236) - Missing space after comma inside a string being reported [\#233](https://github.com/inaka/elvis/issues/233) +- Unhandled abstract form issue with fun\(\(...\) [\#239](https://github.com/inaka/elvis/issues/239) + +- Non spacing not detected [\#221](https://github.com/inaka/elvis/issues/221) + **Closed issues:** +- Release version 0.2.5 [\#266](https://github.com/inaka/elvis/issues/266) + +- Order line results by line\_num [\#219](https://github.com/inaka/elvis/issues/219) + +- White output [\#209](https://github.com/inaka/elvis/issues/209) + +- Don't use spaces for indentation [\#178](https://github.com/inaka/elvis/issues/178) + +- Fix the specs on elvis\_style and elvis\_project [\#162](https://github.com/inaka/elvis/issues/162) + - New rule: max\_function\_length [\#153](https://github.com/inaka/elvis/issues/153) - New rule: max\_module\_length [\#152](https://github.com/inaka/elvis/issues/152) +- No Trailing Whitespace [\#147](https://github.com/inaka/elvis/issues/147) + **Merged pull requests:** +- \[Closes \#266\] Release 0.2.5 [\#267](https://github.com/inaka/elvis/pull/267) ([jfacorro](https://github.com/jfacorro)) + - \[Closes \#263\] Options for max function length [\#265](https://github.com/inaka/elvis/pull/265) ([jfacorro](https://github.com/jfacorro)) - \[Closes \#261\] Options for max module line length [\#264](https://github.com/inaka/elvis/pull/264) ([jfacorro](https://github.com/jfacorro)) @@ -74,8 +110,6 @@ - Not using elvis.config from the PR branch [\#242](https://github.com/inaka/elvis/issues/242) -- Unhandled abstract form issue with fun\(\(...\) [\#239](https://github.com/inaka/elvis/issues/239) - **Closed issues:** - Pre-release 0.2.5-beta3 [\#246](https://github.com/inaka/elvis/issues/246) @@ -94,28 +128,12 @@ [Full Changelog](https://github.com/inaka/elvis/compare/0.2.5-beta...0.2.5-beta2) -**Implemented enhancements:** - -- Improve git\_for\_deps\_erlang\_mk and git\_for\_deps\_rebar [\#199](https://github.com/inaka/elvis/issues/199) - -- Add --version option [\#174](https://github.com/inaka/elvis/issues/174) - -**Fixed bugs:** - -- Non spacing not detected [\#221](https://github.com/inaka/elvis/issues/221) - **Closed issues:** - exception error: undefined function [\#230](https://github.com/inaka/elvis/issues/230) -- Order line results by line\_num [\#219](https://github.com/inaka/elvis/issues/219) - - Instead of using master, use the current branch for elvis.config [\#216](https://github.com/inaka/elvis/issues/216) -- White output [\#209](https://github.com/inaka/elvis/issues/209) - -- Don't use spaces for indentation [\#178](https://github.com/inaka/elvis/issues/178) - - DRY [\#28](https://github.com/inaka/elvis/issues/28) **Merged pull requests:** @@ -150,8 +168,6 @@ **Implemented enhancements:** -- Add an elvis:rock\_this/1 function to rock specific modules [\#159](https://github.com/inaka/elvis/issues/159) - - Investigate erl\_tidy [\#38](https://github.com/inaka/elvis/issues/38) **Fixed bugs:** @@ -168,10 +184,6 @@ - Specify source file on the command line [\#170](https://github.com/inaka/elvis/issues/170) -- Fix the specs on elvis\_style and elvis\_project [\#162](https://github.com/inaka/elvis/issues/162) - -- No Trailing Whitespace [\#147](https://github.com/inaka/elvis/issues/147) - - Don't let modules loose [\#29](https://github.com/inaka/elvis/issues/29) - Exported vs. Non-exported [\#27](https://github.com/inaka/elvis/issues/27)