diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index e1eea1d..0e65cea 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index c55072b..323152a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,5 +4,8 @@ - + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 218a144..2c288cf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ plugins { id 'application' - id 'com.github.ben-manes.versions' version '0.42.0' + id 'com.github.ben-manes.versions' version '0.44.0' id 'idea' - id 'io.gitlab.arturbosch.detekt' version '1.21.0' + id 'io.gitlab.arturbosch.detekt' version '1.22.0' id 'java' id 'net.thauvin.erik.gradle.semver' version '1.0.4' - id 'org.jetbrains.kotlin.jvm' version '1.7.20' - id 'org.jetbrains.kotlin.kapt' version '1.7.20' + id 'org.jetbrains.kotlin.jvm' version '1.7.21' + id 'org.jetbrains.kotlin.kapt' version '1.7.21' id 'org.jetbrains.kotlinx.kover' version '0.6.1' - id 'org.sonarqube' version '3.4.0.2513' + id 'org.sonarqube' version '3.5.0.2730' id 'pmd' } @@ -30,7 +30,7 @@ mainClassName = packageName + '.Mobibot' ext.versions = [ log4j: '2.19.0', - pmd : '6.50.0', + pmd : '6.51.0', ] repositories { @@ -55,7 +55,7 @@ dependencies { implementation 'commons-net:commons-net:3.8.0' // Google - implementation 'com.google.code.gson:gson:2.9.1' + implementation 'com.google.code.gson:gson:2.10' implementation 'com.google.guava:guava:31.1-jre' // Kotlin @@ -65,7 +65,7 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.5' // Logging - implementation 'org.slf4j:slf4j-api:2.0.3' + implementation 'org.slf4j:slf4j-api:2.0.4' implementation "org.apache.logging.log4j:log4j-api:$versions.log4j" implementation "org.apache.logging.log4j:log4j-core:$versions.log4j" implementation "org.apache.logging.log4j:log4j-slf4j2-impl:$versions.log4j" @@ -76,7 +76,7 @@ dependencies { implementation 'net.objecthunter:exp4j:0.4.8' implementation 'org.json:json:20220924' implementation 'org.jsoup:jsoup:1.15.3' - implementation 'org.twitter4j:twitter4j-core:4.1.0' + implementation 'org.twitter4j:twitter4j-core:4.1.2' // Thauvin implementation 'net.thauvin.erik:cryptoprice:1.0.0' diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml index 9b88352..49d6c04 100644 --- a/config/detekt/baseline.xml +++ b/config/detekt/baseline.xml @@ -2,8 +2,8 @@ - ComplexMethod:FeedsMgr.kt$FeedsMgr.Companion$@JvmStatic fun saveFeed(entries: Entries, currentFile: String = currentXml) - ComplexMethod:Weather2.kt$Weather2.Companion$@JvmStatic @Throws(ModuleException::class) fun getWeather(query: String, apiKey: String?): List<Message> + CyclomaticComplexMethod:FeedsMgr.kt$FeedsMgr.Companion$@JvmStatic fun saveFeed(entries: Entries, currentFile: String = currentXml) + CyclomaticComplexMethod:Weather2.kt$Weather2.Companion$@JvmStatic @Throws(ModuleException::class) fun getWeather(query: String, apiKey: String?): List<Message> LongMethod:FeedsMgr.kt$FeedsMgr.Companion$@JvmStatic fun saveFeed(entries: Entries, currentFile: String = currentXml) LongMethod:Mobibot.kt$Mobibot.Companion$@JvmStatic @Throws(Exception::class) fun main(args: Array<String>) LongMethod:StockQuote.kt$StockQuote.Companion$@JvmStatic @Throws(ModuleException::class) fun getQuote(symbol: String, apiKey: String?): List<Message> diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..943f0cb 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..e9ae037 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-rc-3-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..65dcd68 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/gradlew.bat b/gradlew.bat index f127cfd..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Info.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Info.kt index 98aaba9..b27fc43 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Info.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Info.kt @@ -77,7 +77,7 @@ class Info(private val tell: Tell, private val seen: Seen) : AbstractCommand() { append(years).append(" year".plural(years)).append(' ') } if (months > 0) { - append(weeks).append(" month".plural(months)).append(' ') + append(months).append(" month".plural(months)).append(' ') } if (weeks > 0) { append(weeks).append(" week".plural(weeks)).append(' ') diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/WolframAlpha.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/WolframAlpha.kt index b0dc1bf..1d5abd3 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/WolframAlpha.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/WolframAlpha.kt @@ -49,7 +49,6 @@ class WolframAlpha : ThreadedModule() { override val name = "WolframAlpha" private fun getUnits(unit: String?): String { - println("--> $unit") return if (unit?.lowercase() == METRIC) { METRIC } else { diff --git a/src/test/kotlin/net/thauvin/erik/mobibot/commands/InfoTest.kt b/src/test/kotlin/net/thauvin/erik/mobibot/commands/InfoTest.kt index 8230ec4..ba5af62 100644 --- a/src/test/kotlin/net/thauvin/erik/mobibot/commands/InfoTest.kt +++ b/src/test/kotlin/net/thauvin/erik/mobibot/commands/InfoTest.kt @@ -43,7 +43,7 @@ class InfoTest { assertThat( 547800300076L.toUptime(), "upTime(full)" - ).isEqualTo("17 years 2 months 2 weeks 1 day 6 hours 45 minutes") + ).isEqualTo("17 years 4 months 2 weeks 1 day 6 hours 45 minutes") assertThat(24300000L.toUptime(), "upTime(hours minutes)").isEqualTo("6 hours 45 minutes") assertThat(110700000L.toUptime(), "upTime(days hours minutes)").isEqualTo("1 day 6 hours 45 minutes") assertThat( diff --git a/version.properties b/version.properties index ca554e8..c9d4380 100644 --- a/version.properties +++ b/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Wed Oct 12 20:28:52 PDT 2022 -version.buildmeta=751 +#Mon Nov 21 10:09:13 PST 2022 +version.buildmeta=764 version.major=0 version.minor=8 version.patch=0 version.prerelease=rc version.project=mobibot -version.semver=0.8.0-rc+751 +version.semver=0.8.0-rc+764