Hacker News new | ask | show | jobs
by dezgeg 1 day ago
Detect tests somehow (eg. in rust you could check for #[test]) and just skip the analysis for that function?
1 comments

Yeah, that is pretty much what it does already: it tries to recognize test files and skip them. Dupehound is available for 12 languages Today.

Some languages like RUst you mentioned, have a clear tag that says "this is a test," but others do not, so the tool has to guess from file names and ends up missing some and skipping too much.

Also as I mentioned on the answer below, sometimes you actually do want to see the repeats inside tests, or normal code repeats on purpose too. So I am leaning toward letting users wave off one specific case by hand instead of skipping everything blindly.