-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Description
For readability I sometimes want to write a code like:
assert do
# folded because it is too long for one line
foo.bar?(a: aaaaaaaaaaaaaaaaaaaaaa,
b: bbbbbbbbbbbbbbbbbbbbbb,
c: ccccccccccccccccccccccccc)
endHowever power_assert reports a syntax error for such cases, because it just parses codes per lines. Thus, I hope that this "issue" to be fixed in these two steps:
- Just add a note for the known limitation to the README.md.
- Add support for such cases, and remove the note for the fixed problem.
How about that?
うまく伝えられているか自信がないので日本語でも書きます。
冒頭の例のように、1行が長くなりすぎる時に読みやすさのため途中に改行を入れるということはよくあると思います。しかしながら、現在のpower_assertは行単位でコードをパースしているため、このようなコードがあると文法エラーになってしまうという問題があります。そこで、以下の2段階で解決していくのはどうかと考えています。
- まずREADME.mdに、既知の制限事項として注意書きを追加する。
- 複数行に渡る文への対応を進め、作業が完了した時点でその注意書きを削除する。
2は実現可能なのかどうかまだ判断がつかないため、最悪の場合1だけに留まる可能性もあると考えておりますが、何も注意書きがないよりは、ユーザーがいざ同じ問題に遭遇した時に戸惑わずに済むのではないかと思います。
いかがでしょうか?
(この方法で進めてよいということであれば、こちらで作業しPRするつもりでおります。)
Metadata
Metadata
Assignees
Labels
No labels