You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2005/01/17 02:03:34 UTC
Re: svn commit: r125369 - /spamassassin/trunk/rules/70_scraped.cf
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel Quinlan writes:
> Actually, can I suggest a different naming convention?
>
> T_<bug number>_<test name>
>
> For example,
>
> T_4081_FOO_BAR
>
> Short and easy to look up. Also, does your code handle naming for
> new/overlapping/existing predicates for meta rules?
it's a hornet's nest ;)
- - 1. T_ prefix will overlap with our own T_ prefix. I'd prefer a new
prefix to keep them separate. "T_MC_" might work, but I used "MC_" here.
some votes on what people would prefer are welcome ;)
- - 2. there may be multiple revisions of rules and predicates with the same
name inside one bug number, as in bug 2243, so it'd need scoping by both
bug number and comment number; scoping by bug number alone will fail in
this situation.
- - 3. there may be new rules using *existing* rules as meta predicates, so
it can't rename all rulenames found; just the ones where the rules are
defined in that comment's ruleset.
Current code does all those 3. However it does have a failing:
- - It cannot deal with the case (as in bug 2243 comment 14) where a set of
new rules are posted that use rules from a previous comment (cmt 13) as
predicates. However I can't see a good way to deal with that case,
without breaking the case where a new comment revises a ruleset from an
earlier comment, without suffering rule name clashes. So I think that's
an acceptable limitation.
Finally, naming:
Due to our absurd rule-name-length limitation policy ;), we cannot do the
sensible thing, which would indeed be:
MC_{bugnum}_{cmtnum}_{rulename}
but current naming scheme is:
MC_{rulename}_{rnd}
where {rnd} is a 3-digit random number. (the idea is that hopefully
the rulename will be short enough to scrape past the length limit,
since --lint is used to ensure rules are valid before they're checked
into 70_scraped.cf.)
My current plans are to fix this by removing that stupid limit on rulename
and description lengths. They've caused WAY, *WAAAY* more problems than
they solved and I'm sick to death of them! >:( Some sensible wrapping
code would be simpler, and save EVERYONE a lot of trouble.
Once I do that I'll fix automc to use the sensible naming scheme.
- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Exmh CVS
iD8DBQFB6w7mMJF5cimLx9ARAvGyAKCa1YzsmAiNZUvYWpz37TxRpaxuFQCghjok
jsnMuww1KTH67V5PWOlXF3c=
=8MAI
-----END PGP SIGNATURE-----
Re: svn commit: r125369 - /spamassassin/trunk/rules/70_scraped.cf
Posted by Loren Wilton <lw...@earthlink.net>.
> > they solved and I'm sick to death of them! >:( Some sensible wrapping
> > code would be simpler, and save EVERYONE a lot of trouble.
>
> I don't think wrapping code is a solution at all. Email is
> fundamentally 80 columns. Names that go over about a quarter of that
> length mean that the descriptions are going to always wrap which is
> really gross.
FYI: To the best of my knowledge the wrapping code already exists for
descriptions. At least, it existed and worked in 2.6x; I suppose it may
have been removed as an 'improvement' in 3.0.
As best I recall the indenting and alignment code was set for the longest
rule name up to some maximum length, and then any rule name longer than that
simply caused that single line to indent the description farther. This was
simple, readable, and workable.
Line wrap also occurred on those lines that needed it. This was not
necessarily related to the length of the name, since a rule could have a
long name and a short description.
I would be in favor of limiting rule names to 78 characters. This will fit
conveniently in an 80 character mail line.
Loren
Re: svn commit: r125369 - /spamassassin/trunk/rules/70_scraped.cf
Posted by Daniel Quinlan <qu...@pathname.com>.
> Due to our absurd rule-name-length limitation policy ;), we cannot do the
> sensible thing, which would indeed be:
I don't think it's absurd as long as the language is POSIX, C, or "en".
> MC_{bugnum}_{cmtnum}_{rulename}
I don't think cmtnum is needed if the rule has only been mentioned once,
but I'm okay with always including it if that's much simpler to
implement.
T_{Bnnnn}_{rulename}[_{cmtnum}]
so you'd get:
T_B4012_FOO_BAR
for most cases and:
T_B4012_FOO_BAR_11
sometimes.
> but current naming scheme is:
>
> MC_{rulename}_{rnd}
>
> where {rnd} is a 3-digit random number. (the idea is that hopefully
> the rulename will be short enough to scrape past the length limit,
> since --lint is used to ensure rules are valid before they're checked
> into 70_scraped.cf.)
I definitely want to stick with "T_" for test rules.
> My current plans are to fix this by removing that stupid limit on rulename
> and description lengths. They've caused WAY, *WAAAY* more problems than
> they solved and I'm sick to death of them! >:( Some sensible wrapping
> code would be simpler, and save EVERYONE a lot of trouble.
I don't think wrapping code is a solution at all. Email is
fundamentally 80 columns. Names that go over about a quarter of that
length mean that the descriptions are going to always wrap which is
really gross.
I'd be fine with bumping up the limit by 2 (22+2) for T_ rules since
their final name will be 2 characters shorter. I'd even be okay with
not having any limit on size for test rules. I'm not okay with getting
rid of the length limit at this point.
Daniel
--
Daniel Quinlan
http://www.pathname.com/~quinlan/