Description
openedon May 30, 2019
Sopel 7.x task list:
- Use newlines in ListAttribute (see config: split ListAttribute values on newlines #1628)
- Update documentation to discourage usage of comma-separated values (see config: split ListAttribute values on newlines #1628 too)
- Fix
core.channels
(fixed by config: quote ListAttribute items when required #1690) - Update site's tutorial, wiki, etc. to discourage usage of comma-separated values (pushed to WIP Sopel 7 site update at Sopel 7 notes sopel.chat#17)
Sopel 8.x and 9.x task list:
- Deprecation Warning for comma-separated values in Sopel 8.x (see config: deprecate using a comma instead of a newline in ListAttribute #2252)
- Remove management of comma-separated values in Sopel 9.x
TL;DR: in Sopel 7.x, I want to detect \n
to switch to a new mode that doesn't require a delimiter with escape character.
Disclaimer: an escape mechanism was brought in for Sopel 7.x by #1460 to allow comma-separated values. I think it's a great achievement but, sadly, also something that I may want to remove entirely. I'm fully aware that this may mean having to throw off the hard work put in by @HumorBaby and I want to re-assert how much respect I've for his works, past and present.
Current state in Sopel 6.6.x
As of today's version of Sopel 6.6.x branch, this config file:
[spam]
eggs = one, two, three, four, and a half
bacons = grilled
burn out
greasy, fat, and tasty
will be read as this:
>>> config.spam.eggs
['one', ' two', ' three', ' four', ' and a half']
>>> config.spam.bacons
['grilled\nburn out\ngreasy', 'fat', 'and tasty']
Current state in Sopel master
In the master branch, since #1460, it is possible to escape the comma, so it would be like that:
[spam]
eggs = one, two, three, four, and a half
eggs_safe = one, four\, and a half
bacons = grilled
burn out
greasy, fat, and tasty
which result in eggs_safe
to be properly handled, but leaving bacons
still in a poor state:
>>> config.spam.eggs_safe
['one', 'four, and a half']
>>> config.spam.bacons
['grilled\nburn out\ngreasy', 'fat', 'and tasty']
And now, if we want to throw regex pattern (that need to be escaped too), what do we have?
[spam]
regex_pattern = ^Full stop\, Period\\.$, also:? this pattern$
regex_multilines =
^Full stop, Period\.$
also:? this pattern$
Sure thing, regex patterns are not the easiest things to read, but I found that the multi-lines version far more readable.
What's next? What's my plan?
If we take back the example for Sopel 6.6.x:
[spam]
eggs = one, two, three, four, and a half
bacons = grilled
burn out
greasy, fat, and tasty
I want that output:
>>> config.spam.eggs
['one', 'two', 'three', 'four', 'and a half']
>>> config.spam.bacons
['grilled', 'burn out', 'greasy, fat, and tasty']
For Sopel 7.x I want to implement that so:
- no escape delimiter
- single-line expressions will be split by comma, as it is today
- multi-line expressions will be split by break-line, *without split by comma
Then in Sopel 8.x, I want to add a "deprecation warning" on single-line expressions.
Then in Sopel 9.x, I want to remove single-line expressions handling (ie. no more split by comma).