From 296debb19e9b2542dd07de7ea2b9ff66a07dfa71 Mon Sep 17 00:00:00 2001 From: Cal Date: Wed, 23 Oct 2024 17:38:18 +1100 Subject: link to full template, better pattern key fail message --- .../src/main/kotlin/skyhannibuildsystem/ChangelogVerification.kt | 2 +- .../at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/skyhannibuildsystem/ChangelogVerification.kt b/buildSrc/src/main/kotlin/skyhannibuildsystem/ChangelogVerification.kt index 8ac54d6fc..cf2502e43 100644 --- a/buildSrc/src/main/kotlin/skyhannibuildsystem/ChangelogVerification.kt +++ b/buildSrc/src/main/kotlin/skyhannibuildsystem/ChangelogVerification.kt @@ -25,7 +25,7 @@ abstract class ChangelogVerification : DefaultTask() { val prBodyLines get() = prBody.lines() private val prLink = "ignored" - private val templateLocation = "https://github.com/hannibal002/SkyHanni/blob/beta/pull_request_template.md" + private val templateLocation = "https://github.com/hannibal002/SkyHanni/blob/beta/pull_request_template.md?plain=1" @TaskAction fun scanChangelog() { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt index cc251c61f..ad10ba195 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -243,13 +243,15 @@ object RepoPatternManager { setDefaultPatterns() } - val keyShape = Pattern.compile("^(?:[a-z0-9]+\\.)*[a-z0-9]+$") + private val keyShape = Pattern.compile("^(?:[a-z0-9]+\\.)*[a-z0-9]+$") /** * Verify that a key has a valid shape or throw otherwise. */ fun verifyKeyShape(key: String) { - require(keyShape.matches(key)) { "pattern key: \"$key\" failed shape requirements" } + require(keyShape.matches(key)) { + "pattern key: \"$key\" failed shape requirements. Make sure your key only includes lowercase letters, numbers and dots." + } } /** -- cgit