-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix #468] Add include_dirs/1 to elvis_config #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for this? Even if we just meck ktn_code:parse_tree to be sure that it's receiving the appropriate list of directories…
src/elvis_config.erl
Outdated
-spec include_dirs(Config::config() | map()) -> [string()]. | ||
include_dirs(Config) when is_list(Config) -> | ||
lists:flatmap(fun include_dirs/1, Config); | ||
include_dirs(RuleGroup = #{ruleset := "erl_files"}) when is_map(RuleGroup) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't be so strict, let every group have an include_dirs
option, even when it might be useless today.
src/elvis_config.erl
Outdated
maps:get(include_dirs, RuleGroup, ?DEFAULT_INCLUDE_DIRS); | ||
include_dirs(RuleGroup = #{filter := "*.erl"}) when is_map(RuleGroup) -> | ||
maps:get(include_dirs, RuleGroup, ?DEFAULT_INCLUDE_DIRS); | ||
include_dirs(_) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default should not be []
. It should be ?DEFAULT_INCLUDE_DIRS
instead.
b7273a5
to
9020a48
Compare
9020a48
to
f6ee0f9
Compare
f6ee0f9
to
da034ab
Compare
Also: