bitwalker / bitwalker/conform

Empty lists in .conf file

Open
#150 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
378
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Hi,

I might be missing the obvious, but I am not getting it to work. I want to have a config option to set a list of atoms which may be empty. My schema.exs is the following

```
[
extends: [],
import: [],
mappings: [
"foo.bar": [
commented: false,
datatype: [
list: :atom
],
default: [],
hidden: false,
to: "foo.bar"
],
],
transforms: [],
validators: []
]
```

From this conform generates (via conform.configure) the following .conf file:

```
foo.bar =
```

This works fine, as long as I specify any value for `foo.bar`, such as

```
foo.bar = foo, bar
```

But in case I do not specify anything on the right hand side (in order to set the value to the empty list) conform fails with

```
Failed to parse .conf!
Error: Invalid conf file at line 2, column 1:
foo.bar =
```

I've also tried setting `foo.bar =[]` in which case [] is interpreted as the atom :"[]" and the configuration is set to

```
foo: [
bar: [:"[]"]
],
```

Any help would be much appreciated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.