Skip to content
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

Empty lists in .conf file #150

Open
arnomi opened this issue Mar 16, 2018 · 0 comments
Open

Empty lists in .conf file #150

arnomi opened this issue Mar 16, 2018 · 0 comments

Comments

@arnomi
Copy link

arnomi commented Mar 16, 2018

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.

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

No branches or pull requests

1 participant