mirror of
https://github.com/HighCapable/SweetDependency.git
synced 2025-09-08 03:24:29 +08:00
refactor: replace not to !
This commit is contained in:
@@ -267,7 +267,7 @@ internal data class RepositoryDocument(
|
||||
}; nodeName = name
|
||||
if (url.isNotBlank() && path.isNotBlank()) SError.make("There can only be one \"url\" and \"path\" parameter of \"$name\"")
|
||||
if (path.isNotBlank() && (path.startsWith("https://") || path.startsWith("http://"))) SError.make("Invalid repository path: $path")
|
||||
if (url.isNotBlank() && url.startsWith("https://").not() && url.startsWith("http://").not()) SError.make("Invalid repository URL: $url")
|
||||
if (url.isNotBlank() && !url.startsWith("https://") && !url.startsWith("http://")) SError.make("Invalid repository URL: $url")
|
||||
if (path.isNotBlank()) path = path.parseUnixFileSeparator()
|
||||
}
|
||||
}
|
@@ -170,7 +170,7 @@ internal data class RootConfigDocument(
|
||||
artifact.alias.checkingName("$typeName \"$dependencyName\" alias", isCheckMultiName = true)
|
||||
artifact.versions().forEach { (name, _) -> name.checkingName("$typeName \"$dependencyName\" version alias") }
|
||||
if (artifact.alias.isNotBlank())
|
||||
if (checkDuplicateAlias.contains(artifact.alias).not())
|
||||
if (!checkDuplicateAlias.contains(artifact.alias))
|
||||
checkDuplicateAlias[artifact.alias] = dependencyName.current
|
||||
else SError.make(
|
||||
"Duplicated alias \"${artifact.alias}\", " +
|
||||
@@ -230,7 +230,7 @@ internal data class RootConfigDocument(
|
||||
if (artifact.versionRef.isNotBlank())
|
||||
versions()[artifact.versionRef]?.also { artifact.version = it } ?: resolveVersionRef()
|
||||
else SError.make("Missing declared version when configuring $typeName \"$dependencyName\"")
|
||||
else if (artifact.version().isBlank.not() && artifact.versionRef.isNotBlank() && duplicate.not())
|
||||
else if (!artifact.version().isBlank && artifact.versionRef.isNotBlank() && !duplicate)
|
||||
SError.make("$firstTypeName \"$dependencyName\" can only have one \"version\" or \"version-ref\" node, please delete one")
|
||||
}
|
||||
currentDependencies.eachDependencies { dependencyName, artifact ->
|
||||
|
@@ -64,7 +64,7 @@ internal data class VersionFilterDocument(
|
||||
* 当前是否不存在排除列表
|
||||
* @return [Boolean]
|
||||
*/
|
||||
internal fun isNotEmpty() = isEmpty().not()
|
||||
internal fun isNotEmpty() = !isEmpty()
|
||||
|
||||
/**
|
||||
* 依赖于当前 [version] 提供的版本并在 [all] 中排除 (不区分大小写)
|
||||
@@ -74,7 +74,7 @@ internal data class VersionFilterDocument(
|
||||
* @return [ExclusionList]
|
||||
*/
|
||||
internal fun depends(version: DependencyVersion) = clone().apply {
|
||||
if (version.isAutowire.not() && version.isBlank.not()) all().removeAll { version.deployed.lowercase().contains(it.lowercase()) }
|
||||
if (!version.isAutowire && !version.isBlank) all().removeAll { version.deployed.lowercase().contains(it.lowercase()) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -158,12 +158,12 @@ internal class RootConfigDocumentMapping internal constructor(private val config
|
||||
}
|
||||
}
|
||||
pluginsContents.onEachIndexed { index, content ->
|
||||
if ((content.trim().startsWith(VERSION_NODE_CONTENT) && content.startsWith(SPACE_OF_4)).not()) return@onEachIndexed
|
||||
if (!(content.trim().startsWith(VERSION_NODE_CONTENT) && content.startsWith(SPACE_OF_4))) return@onEachIndexed
|
||||
pluginsMapping[pluginsLine].versionLine = index + pluginsStartLine
|
||||
pluginsLine++
|
||||
}.clear()
|
||||
librariesContents.onEachIndexed { index, content ->
|
||||
if ((content.trim().startsWith(VERSION_NODE_CONTENT) && content.startsWith(SPACE_OF_6)).not()) return@onEachIndexed
|
||||
if (!(content.trim().startsWith(VERSION_NODE_CONTENT) && content.startsWith(SPACE_OF_6))) return@onEachIndexed
|
||||
librariesMapping[librariesLine].versionLine = index + librariesStartLine
|
||||
librariesLine++
|
||||
}.clear()
|
||||
|
Reference in New Issue
Block a user