Since ack's behavior is to OR all the type expressions together, there isn't a way to do this directly in the .ackrc
without changing ack.
However, I was able to write a bash function wrapping ack that adds --notest
unless --test
is passed.
function ack { test_flag='--notest' for arg in "$*"; do case "$arg" in --test) test_flag='' ;; esac done command ack "$*" $testflag }