Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Make config fetching safer #10

Merged
merged 1 commit into from
Oct 15, 2015
Merged

Make config fetching safer #10

merged 1 commit into from
Oct 15, 2015

Conversation

BlakeWilliams
Copy link
Contributor

The current code makes a few assumptions about the format of your
.codeclimate.yml which can cause the engine to crash.

This changes the way we fetch the configuration to consider that not
only may the keys not be present, but they might also not always be the
type we expect.

end
end

def engine_languages
@engine_language ||= languages = engine_config.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is languages used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, removing it.

@gdiggs
Copy link
Contributor

gdiggs commented Oct 15, 2015

Is the purpose of this changeset to be backwards compatible?

@BlakeWilliams
Copy link
Contributor Author

Yes, and to prevent crashing when someone gives us an array of languages when they want to rely purely on the defaults.

@gdiggs
Copy link
Contributor

gdiggs commented Oct 15, 2015

LGTM

The current code makes a few assumptions about the format of your
`.codeclimate.yml` which can cause the engine to crash.

This changes the way we fetch the configuration to consider that not
only may the keys not be present, but they might also not always be the
type we expect.
@BlakeWilliams BlakeWilliams merged commit 9a6f99c into master Oct 15, 2015
@BlakeWilliams BlakeWilliams deleted the bmw-config-tweaks branch October 15, 2015 18:04
@BlakeWilliams
Copy link
Contributor Author

Thanks for the review!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants