Empty lists in .conf file

オープン
#150 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
elixir
領域
tooling

調査の方向性

まず、示されている schema.exs と生成された .conf ファイルを使い、conform.configure を通じて問題を再現します。空のリストがどのようにパースされるか、また foo.bar = と foo.bar =[] がどのように異なるかを調べます。リスト・オブ・アトムのオプションを、[] をアトムとして解釈せずに空のリストとして設定できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Elixir
スター
379
フォーク
59
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitwalker/conform のほかの issue

bitwalker/conform の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。