You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Dallas Engelken <da...@nmgi.com> on 2005/11/21 19:02:13 UTC
Re: latest HEAD -lint warns ... "warn: Found = in conditional,
should be == ..."
On Mon, 2005-11-21 at 12:50 -0500, Theo Van Dinter wrote:
> On Mon, Nov 21, 2005 at 09:27:52AM -0800, Justin Mason wrote:
> > Either way though, I do see the problem -- could someone open a bug at the
> > BZ so we can decide what the "correct" way to do this should be
> > and possibly add support for it to the engine?
>
> Is this something that we need to solve? Rules are designed to look for
> things in messages, adding in the ability to say "run but match nothing"
> doesn't seem like a useful feature. The known solution to the problem is to
> remove the rule.
>
i would agree that this should not be a SA issue, except the
documentation spells out the usage of meta very clearly as
meta SYMBOLIC_TEST_NAME boolean expression
and 'meta TEST 0' follows those guidelines.
the problem with deleting a rule is if other meta's depended on that
rule, your lint would fail and your RDJ would fail to update. the more
elegant solution may be to leave the original rule in place and 0 out
the score?
but, either the code should be changed to support 'meta TEST 0' or the
documentation should be updated.
dallas
Re: latest HEAD -lint warns ... "warn: Found = in conditional, should be == ..."
Posted by Theo Van Dinter <fe...@apache.org>.
On Mon, Nov 21, 2005 at 01:02:13PM -0500, Dallas Engelken wrote:
> meta SYMBOLIC_TEST_NAME boolean expression
>
> and 'meta TEST 0' follows those guidelines.
>
> the problem with deleting a rule is if other meta's depended on that
> rule, your lint would fail and your RDJ would fail to update. the more
> elegant solution may be to leave the original rule in place and 0 out
> the score?
That would be my suggestion. The rule will still take up memory (which it
would anyway), but won't actually run with the 0 score. The flip is that
users can reactivate the rule if they want, which may be good or bad.
> but, either the code should be changed to support 'meta TEST 0' or the
> documentation should be updated.
Hrm. Just to note, it's not as easy as looking for a number, all of these
result in the same problem:
0
0 <OP> 0
(0)
(0 <OP> 0)
an easy solution would be to change the code from:
if (my $result = ( $self->{'tests_already_hit'}->{'__HTML_LENGTH_384'} && $self->{'tests_already_hit'}->{'__TAG_EXISTS_CENTER'} ) ) { $self->got_hit(q#HTML_SHORT_CENTER#, "", $result); }
to:
$result = ( $self->{'tests_already_hit'}->{'__HTML_LENGTH_384'} && $self->{'tests_already_hit'}->{'__TAG_EXISTS_CENTER'} );
if ($result) { $self->got_hit(q#HTML_SHORT_CENTER#, "", $result); }
that way the original version would become:
$result = 0;
if ($result) { $self->got_hit(q#SARE_OBFU_OBLIGATION#, "", $result); }
and do the "my $result" before the tests run.
--
Randomly Generated Tagline:
Blood is much thicker than water; and much tastier too.