Skip to content

Commit

Permalink
fix: find regex in test configuration hierarchy check instead of match (
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire authored Aug 22, 2024
1 parent aa6e9d0 commit 54e4357
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,15 @@ abstract class AbstractAnalyze extends ConfiguredTask {
* Checks whether a configuration is considered to be a test configuration in order to skip it.
* A configuration is considered a test configuration if and only if any of the following conditions holds:
* <ul>
* <li>the name of the configuration or any of its parent configurations matches /((^|[a-z0-9_])T|(^|_)t)est([A-Z0-9_]|$)/</li>
* <li>the name of the configuration or any of its parent configurations contains a match for /((^|[a-z0-9_])T|(^|_)t)est([A-Z0-9_]|$)/</li>
* </ul>
* The intent of the regular expression is to match `test` in a camel case or snake case configuration name.
*/
@groovy.transform.CompileStatic
static boolean isTestConfigurationCheck(Configuration configuration) {
boolean isTestConfiguration = configuration.name =~ /((^|[a-z0-9_])T|(^|_)t)est([A-Z0-9_]|$)/
configuration.hierarchy.each {
isTestConfiguration |= it.name ==~ /((^|[a-z0-9_])T|(^|_)t)est([A-Z0-9_]|$)/
isTestConfiguration |= (it.name =~ /((^|[a-z0-9_])T|(^|_)t)est([A-Z0-9_]|$)/) as boolean
}
isTestConfiguration
}
Expand Down

0 comments on commit 54e4357

Please sign in to comment.