Login
Second attempt to provide warnings when a useless "## no critic"
is found. This time, I completely re-wrote the way that we
keep track of disabled lines. Instead of just marking each
line that was affected by a no-critic, I keep track of each
no-critic and the region of lines that it affects. This
makes it possible to report which no-critic markers are
not having an effect, rather than reporting all the lines
that were disabled but had no violations.
I had a hard time thinking of a good data structure
for expressing all this. So this certianly isn't the
fastest code. But this also isn't the slowest part
of Perl-Critic.
Along the way, I found that my strategy for finding
useless no-critic markers was fundamentally flawed --
the most important thing is to keep track of the
violations that were *not* reported. That way,
you can tell if a no-critic marker was effective
or not.