How can I exclude the sample folder from the following rules? with this configuration it is not working and detekt keeps parsing the sample folder
UndocumentedPublicClass:
active: true
excludes: &samples
- '**/rd/compose/samples/**'
includes: &composeComponent
- '**/rd/compose/**'
UndocumentedPublicFunction:
active: true
excludes: *samples
includes: *composeComponent
OutdatedDocumentation:
active: true
excludes: *samples
includes: *composeComponent
allowParamOnConstructorProperties: true
Problem:
There is a bug in Detekt that prevents configurations like yours from working: the
excludespath filters are not evaluated ifincludesare present. The fix has just been implemented and is currently in the 1.23.0 milestone. Let's hope for a release soon. Unfortunately, the logic seems to have been in place for years so reverting to a previous release is probably not an option.Workaround:
While we wait for that fix, consider implicitly excluding
samples/by explicitly including all other direct subfolders and files withincompose/. For example:This should do the trick but should only be considered as a temporary solution because it would require manual effort to update that list as you add, rename, or remove files & folders.