-
Notifications
You must be signed in to change notification settings - Fork 24
Add engine_config class #13
Conversation
cc @codeclimate/review |
map[language.downcase] = {} | ||
end | ||
elsif languages.is_a?(Hash) | ||
languages.each_with_object({}) do |language, map| |
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.
What if we did something like |(key, value), map|
here instead of doing the deconstructing in the line below?
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.
Hah, I did []
last time. Too much Elixir. 😄
Good to go? |
@@ -29,7 +29,7 @@ def run | |||
end | |||
|
|||
def mass_threshold |
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.
Maybe now is not the time, but it seems like these per-language main
classes are a good case for inheritance?
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.
Yep, I started thinking the same thing and was going to look into it after this PR is good to go.
One refactor suggestion, but maybe it should be saved for later. LGTM. |
Yeah, I think it's a separate concern so I'll handle that in another PR. |
Thanks for the reviews! |
This adds the `EngineConfig` class for normalizing the passed in engine config in a single place instead of using `fetch` all over the codebase with hardcoded paths. This also fixes the path `mass_threshold` looks for when fetching the config.
1823f3a
to
2b3e74b
Compare
This adds the
EngineConfig
class for normalizing the passed in engineconfig in a single place instead of using
fetch
all over the codebasewith hardcoded paths.
This also fixes the path
mass_threshold
looks for when fetching theconfig.