Description
I've seen previous issues talking about this issue;
#115
#113
One particular answer (#113 (comment)) mentions going to a documentation page but it doesn't seem to have relevant information anymore. It contains a hash / fragment in the URL (#section-exclude-paths-for-specific-engines
) that doesn't link to anywhere on the page.
It also gives this code snippet, which I believe is old as the codeclimate validate-config
CLI command tells me the engines
key is unrecognised.
engines:
duplication:
enabled: true
exclude_paths:
- spec/
The current documentation mentions custom file name patterns but it doesn't mention how this could be used to, for example, target all JS files that don't have a spec
suffix, e.g.
src/app.js ##TARGET
src/components/app/index.js ##TARGET
src/components/app/tests/index.spec.js ##IGNORE
Any help would be appreciated. I've tried engines
, and then using various connotations of regexes/globs within patterns.duplication.config.languages.javascript.patterns
. If this is indeed the right approach, then I'm assuming the pattern needs to be a single magic pattern that does everything in one go, as from examining the code I see that if a file name matches any single pattern in the array, it's included:
codeclimate-duplication/lib/cc/engine/analyzers/file_list.rb
Lines 37 to 45 in 0646b13