conform icon indicating copy to clipboard operation
conform copied to clipboard

Empty lists in .conf file

Open arnomi opened this issue 7 years ago • 0 comments

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.

arnomi avatar Mar 16 '18 07:03 arnomi