SA Bugzilla – Bug 5442
Provide line continuation facility for rules
Last modified: 2010-01-27 04:09:31 UTC
Some obfuscation rules can be VERY long, and as a result difficult to both read and maintain when they aren't generated automatically. Some other rules can also get rather long. Thus, a simple line continuation facility for rules is suggested. I believe the suggested format is simple enough that it should be quite trivial to recognize and handle in parsing, and trivial to glue the rules back together when generating the compiled rules. Allow line continuation with the normal backslash-newline technique. The following line could begin with any amount of whitespace, and the rule continuation text would be the first non-whitespace on the line. This second line could also be continued in the same manner, etc. The rule would end with a line not containing line continuation. You could limit this continuation to only inside the regex delimiters, but it would be simpler and probably safer to just allow it anywhere in a rule line. The various pieces would simply be glued back together by eliminating the line continuation characters and any associated whitespace. (Thus you could not break a rule just before whitespace in the regex, but you could perhaps break it *after* whitespace in the regex if you wanted to allow that.)
Created attachment 4183 [details] Standard "backslash-plus-newline" line-continuation syntax "backslash at end of line" continuation method, with a few weirdnesses: 1) Empty lines (lines consisting only of whitespace) will be discarded, with the first non-empty line after a continued line being the one used for continuation. 2) Putting a \ at the end of a comment line will make the next line part of the comment.
For consideration in 3.3.0
moving some 3.3.0-targeted bugs into the vague Future. feel free to retarget to 3.3.1 if you think you'll be able to work on them
reassigning, too
Bear in mind that apart from changing the SpamAssassin library, the supporting tools/scripts and rules QA mechanisms need to be enhanced too.