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

Conversation

@wfleming
Copy link
Contributor

Addresses #136

The changes made in #135 didn't account for configuring the languages
with empty hash contents. With YAML parsing, something like

languages:
  python:

Gets parsed as { "languages" => { "python" => "" } }, leading to a
NoMethodError when the Python class attempted to discover the
configured Python version.

EngineConfig already had logic to ensure a language configuration was
a hash, so this makes the appropriate coercing method public & uses it
from the Python class. (Since the Python version key is a Python-only
option, the EngineConfig class still doesn't seem like the appropriate
place for that logic.)

cc @codeclimate/review @maxjacobson

@maxjacobson
Copy link
Contributor

Nice! Code change LGTM. Do you think it's worth adding a test?

Addresses #136

The changes made in #135 didn't account for configuring the languages
with empty hash contents. With YAML parsing, something like

```
languages:
  python:
```

Gets parsed as `{ "languages" => { "python" => "" } }`, leading to a
`NoMethodError` when the Python class attempted to discover the
configured Python version.

`EngineConfig` already had logic to ensure a language configuration was
a hash, so this makes the appropriate coercing method public & uses it
from the Python class. (Since the python version key is a Python-only
option, the `EngineConfig` class still doesn't seem like the appropriate
place for that logic.)
@wfleming wfleming force-pushed the will/empty-hash-config branch from 5a15439 to 19b23f5 Compare October 10, 2016 17:01
@wfleming
Copy link
Contributor Author

Test added @maxjacobson. I'm merging.

@wfleming wfleming merged commit 61ed1f8 into master Oct 10, 2016
@wfleming wfleming deleted the will/empty-hash-config branch October 10, 2016 17:05
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.

3 participants