From cf205a707c26aa700ef4143b1322436f869b2cb9 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Sun, 24 Jan 2021 20:25:49 -0600 Subject: [PATCH] Format --- build.gradle | 3 +- license_header | 18 +++++++++ src/main/kotlin/mdnet/BackendApi.kt | 3 +- src/main/kotlin/mdnet/Constants.kt | 2 +- src/main/kotlin/mdnet/Main.kt | 3 +- src/main/kotlin/mdnet/MangaDexClient.kt | 3 +- src/main/kotlin/mdnet/ServerManager.kt | 3 +- src/main/kotlin/mdnet/cache/ImageStorage.kt | 3 +- src/main/kotlin/mdnet/cache/metadata.kt | 3 +- src/main/kotlin/mdnet/data/Statistics.kt | 2 +- src/main/kotlin/mdnet/data/Token.kt | 2 +- src/main/kotlin/mdnet/logging/logging.kt | 2 +- .../mdnet/metrics/DefaultMicrometerMetrics.kt | 3 +- .../mdnet/metrics/GeoIpMetricsFilter.kt | 3 +- .../mdnet/metrics/PostTransactionLabeler.kt | 3 +- .../kotlin/mdnet/netty/ApplicationNetty.kt | 3 +- src/main/kotlin/mdnet/netty/Keys.kt | 39 +++++++++---------- src/main/kotlin/mdnet/server/ImageServer.kt | 3 +- src/main/kotlin/mdnet/server/common.kt | 3 +- src/main/kotlin/mdnet/server/crypto.kt | 3 +- .../kotlin/mdnet/settings/ClientSettings.kt | 2 +- .../kotlin/mdnet/settings/RemoteSettings.kt | 2 +- src/test/kotlin/mdnet/Config.kt | 3 +- .../kotlin/mdnet/cache/ImageStorageTest.kt | 3 +- .../mdnet/metrics/GeoIpMetricsFilterTest.kt | 18 +++++++++ .../kotlin/mdnet/server/ImageServerTest.kt | 3 +- 26 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 license_header diff --git a/build.gradle b/build.gradle index fdc19e4..edba11c 100644 --- a/build.gradle +++ b/build.gradle @@ -95,7 +95,8 @@ spotless { endWithNewline() } kotlin { - ktlint("0.40.0") + ktlint("0.40.0").userData(["disabled_rules": "no-wildcard-imports"]) + licenseHeaderFile "license_header" trimTrailingWhitespace() endWithNewline() } diff --git a/license_header b/license_header new file mode 100644 index 0000000..141f93f --- /dev/null +++ b/license_header @@ -0,0 +1,18 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . +*/ \ No newline at end of file diff --git a/src/main/kotlin/mdnet/BackendApi.kt b/src/main/kotlin/mdnet/BackendApi.kt index 8920821..77f8d69 100644 --- a/src/main/kotlin/mdnet/BackendApi.kt +++ b/src/main/kotlin/mdnet/BackendApi.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet import com.fasterxml.jackson.databind.DeserializationFeature diff --git a/src/main/kotlin/mdnet/Constants.kt b/src/main/kotlin/mdnet/Constants.kt index 3118009..9fb9ca9 100644 --- a/src/main/kotlin/mdnet/Constants.kt +++ b/src/main/kotlin/mdnet/Constants.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet import java.time.Duration diff --git a/src/main/kotlin/mdnet/Main.kt b/src/main/kotlin/mdnet/Main.kt index 41c97f0..c9487e6 100644 --- a/src/main/kotlin/mdnet/Main.kt +++ b/src/main/kotlin/mdnet/Main.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet import ch.qos.logback.classic.LoggerContext diff --git a/src/main/kotlin/mdnet/MangaDexClient.kt b/src/main/kotlin/mdnet/MangaDexClient.kt index 5a3dbd6..73683d2 100644 --- a/src/main/kotlin/mdnet/MangaDexClient.kt +++ b/src/main/kotlin/mdnet/MangaDexClient.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet import com.fasterxml.jackson.core.JsonProcessingException diff --git a/src/main/kotlin/mdnet/ServerManager.kt b/src/main/kotlin/mdnet/ServerManager.kt index 98ab203..e2dc50f 100644 --- a/src/main/kotlin/mdnet/ServerManager.kt +++ b/src/main/kotlin/mdnet/ServerManager.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet import io.micrometer.prometheus.PrometheusConfig diff --git a/src/main/kotlin/mdnet/cache/ImageStorage.kt b/src/main/kotlin/mdnet/cache/ImageStorage.kt index 3e42458..1667156 100644 --- a/src/main/kotlin/mdnet/cache/ImageStorage.kt +++ b/src/main/kotlin/mdnet/cache/ImageStorage.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.cache import com.fasterxml.jackson.databind.ObjectMapper diff --git a/src/main/kotlin/mdnet/cache/metadata.kt b/src/main/kotlin/mdnet/cache/metadata.kt index 48f6fe3..2ccdbc4 100644 --- a/src/main/kotlin/mdnet/cache/metadata.kt +++ b/src/main/kotlin/mdnet/cache/metadata.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.cache import org.ktorm.schema.* diff --git a/src/main/kotlin/mdnet/data/Statistics.kt b/src/main/kotlin/mdnet/data/Statistics.kt index 4e35852..481e9e7 100644 --- a/src/main/kotlin/mdnet/data/Statistics.kt +++ b/src/main/kotlin/mdnet/data/Statistics.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet.data import com.fasterxml.jackson.databind.PropertyNamingStrategies diff --git a/src/main/kotlin/mdnet/data/Token.kt b/src/main/kotlin/mdnet/data/Token.kt index 20205d3..72582d8 100644 --- a/src/main/kotlin/mdnet/data/Token.kt +++ b/src/main/kotlin/mdnet/data/Token.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet.data import com.fasterxml.jackson.databind.PropertyNamingStrategies diff --git a/src/main/kotlin/mdnet/logging/logging.kt b/src/main/kotlin/mdnet/logging/logging.kt index 2ee2899..a4c0c3f 100644 --- a/src/main/kotlin/mdnet/logging/logging.kt +++ b/src/main/kotlin/mdnet/logging/logging.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet.logging import org.slf4j.Logger diff --git a/src/main/kotlin/mdnet/metrics/DefaultMicrometerMetrics.kt b/src/main/kotlin/mdnet/metrics/DefaultMicrometerMetrics.kt index 708ea56..8d67a45 100644 --- a/src/main/kotlin/mdnet/metrics/DefaultMicrometerMetrics.kt +++ b/src/main/kotlin/mdnet/metrics/DefaultMicrometerMetrics.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.metrics import io.micrometer.core.instrument.Tag diff --git a/src/main/kotlin/mdnet/metrics/GeoIpMetricsFilter.kt b/src/main/kotlin/mdnet/metrics/GeoIpMetricsFilter.kt index 8780616..a72324c 100644 --- a/src/main/kotlin/mdnet/metrics/GeoIpMetricsFilter.kt +++ b/src/main/kotlin/mdnet/metrics/GeoIpMetricsFilter.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.metrics import com.maxmind.db.CHMCache diff --git a/src/main/kotlin/mdnet/metrics/PostTransactionLabeler.kt b/src/main/kotlin/mdnet/metrics/PostTransactionLabeler.kt index 5fdfc59..81b1515 100644 --- a/src/main/kotlin/mdnet/metrics/PostTransactionLabeler.kt +++ b/src/main/kotlin/mdnet/metrics/PostTransactionLabeler.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.metrics import org.http4k.core.HttpTransaction diff --git a/src/main/kotlin/mdnet/netty/ApplicationNetty.kt b/src/main/kotlin/mdnet/netty/ApplicationNetty.kt index 1e7065a..31f0314 100644 --- a/src/main/kotlin/mdnet/netty/ApplicationNetty.kt +++ b/src/main/kotlin/mdnet/netty/ApplicationNetty.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.netty import io.netty.bootstrap.ServerBootstrap diff --git a/src/main/kotlin/mdnet/netty/Keys.kt b/src/main/kotlin/mdnet/netty/Keys.kt index 49c1fc1..f246596 100644 --- a/src/main/kotlin/mdnet/netty/Keys.kt +++ b/src/main/kotlin/mdnet/netty/Keys.kt @@ -1,24 +1,21 @@ -// The code below is adapted from from https://github.com/Mastercard/client-encryption-java/blob/master/src/main/java/com/mastercard/developer/utils/EncryptionUtils.java -// -// Copyright (c) 2019 Mastercard -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . +*/ package mdnet.netty import java.io.ByteArrayOutputStream diff --git a/src/main/kotlin/mdnet/server/ImageServer.kt b/src/main/kotlin/mdnet/server/ImageServer.kt index cc82beb..20a7683 100644 --- a/src/main/kotlin/mdnet/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/server/ImageServer.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.server import com.fasterxml.jackson.core.JsonProcessingException diff --git a/src/main/kotlin/mdnet/server/common.kt b/src/main/kotlin/mdnet/server/common.kt index 0035f47..acf557d 100644 --- a/src/main/kotlin/mdnet/server/common.kt +++ b/src/main/kotlin/mdnet/server/common.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.server import mdnet.BuildInfo diff --git a/src/main/kotlin/mdnet/server/crypto.kt b/src/main/kotlin/mdnet/server/crypto.kt index b059ec3..80be24a 100644 --- a/src/main/kotlin/mdnet/server/crypto.kt +++ b/src/main/kotlin/mdnet/server/crypto.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.server import java.security.MessageDigest diff --git a/src/main/kotlin/mdnet/settings/ClientSettings.kt b/src/main/kotlin/mdnet/settings/ClientSettings.kt index daf3f10..2db8dce 100644 --- a/src/main/kotlin/mdnet/settings/ClientSettings.kt +++ b/src/main/kotlin/mdnet/settings/ClientSettings.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet.settings import com.fasterxml.jackson.databind.PropertyNamingStrategies diff --git a/src/main/kotlin/mdnet/settings/RemoteSettings.kt b/src/main/kotlin/mdnet/settings/RemoteSettings.kt index ab0bc7b..ac49220 100644 --- a/src/main/kotlin/mdnet/settings/RemoteSettings.kt +++ b/src/main/kotlin/mdnet/settings/RemoteSettings.kt @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ +*/ package mdnet.settings import com.fasterxml.jackson.databind.PropertyNamingStrategies diff --git a/src/test/kotlin/mdnet/Config.kt b/src/test/kotlin/mdnet/Config.kt index 04d5006..77a4675 100644 --- a/src/test/kotlin/mdnet/Config.kt +++ b/src/test/kotlin/mdnet/Config.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet import io.kotest.core.config.AbstractProjectConfig diff --git a/src/test/kotlin/mdnet/cache/ImageStorageTest.kt b/src/test/kotlin/mdnet/cache/ImageStorageTest.kt index fd0ea88..b2d232f 100644 --- a/src/test/kotlin/mdnet/cache/ImageStorageTest.kt +++ b/src/test/kotlin/mdnet/cache/ImageStorageTest.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.cache import io.kotest.assertions.throwables.shouldThrow diff --git a/src/test/kotlin/mdnet/metrics/GeoIpMetricsFilterTest.kt b/src/test/kotlin/mdnet/metrics/GeoIpMetricsFilterTest.kt index 4e65846..e3f07f2 100644 --- a/src/test/kotlin/mdnet/metrics/GeoIpMetricsFilterTest.kt +++ b/src/test/kotlin/mdnet/metrics/GeoIpMetricsFilterTest.kt @@ -1,3 +1,21 @@ +/* +Mangadex@Home +Copyright (c) 2020, MangaDex Network +This file is part of MangaDex@Home. + +MangaDex@Home is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +MangaDex@Home is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this MangaDex@Home. If not, see . +*/ package mdnet.metrics import com.maxmind.geoip2.DatabaseReader diff --git a/src/test/kotlin/mdnet/server/ImageServerTest.kt b/src/test/kotlin/mdnet/server/ImageServerTest.kt index f3e5241..1c1c45d 100644 --- a/src/test/kotlin/mdnet/server/ImageServerTest.kt +++ b/src/test/kotlin/mdnet/server/ImageServerTest.kt @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this MangaDex@Home. If not, see . - */ -/* ktlint-disable no-wildcard-imports */ +*/ package mdnet.server import io.kotest.assertions.withClue