From 7f353ba180db757c8e37e51d271b2220dc08df88 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Tue, 2 Apr 2024 21:36:20 +0200 Subject: [PATCH] format --- .../tasks/softspoon/ApplyFilePatches.kt | 4 +++- .../tasks/softspoon/RebuildFilePatches.kt | 6 ++++- .../io/papermc/paperweight/util/ATTest.kt | 22 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt index 75d1549a9..5e7d4fea2 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt @@ -101,7 +101,9 @@ abstract class ApplyFilePatches : BaseTask() { commit() if (result.exit != 0) { - throw Exception("Failed to apply ${result.summary.failedMatches}/${result.summary.failedMatches + result.summary.exactMatches + result.summary.accessMatches + result.summary.offsetMatches + result.summary.fuzzyMatches} hunks") + val total = result.summary.failedMatches + result.summary.exactMatches + + result.summary.accessMatches + result.summary.offsetMatches + result.summary.fuzzyMatches + throw Exception("Failed to apply ${result.summary.failedMatches}/$total hunks") } if (!verbose.get()) { diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/RebuildFilePatches.kt b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/RebuildFilePatches.kt index 0ee8930f2..c6b910aef 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/RebuildFilePatches.kt +++ b/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/RebuildFilePatches.kt @@ -115,7 +115,11 @@ abstract class RebuildFilePatches : BaseTask() { } if (atFileOut.isPresent) { - AccessTransformFormats.FML.writeLF(atFileOut.convertToPath(), oldAts, "# This file is auto generated, any changes may be overridden!\n# See CONTRIBUTING.md on how to add access transformers.\n") + AccessTransformFormats.FML.writeLF( + atFileOut.convertToPath(), + oldAts, + "# This file is auto generated, any changes may be overridden!\n# See CONTRIBUTING.md on how to add access transformers.\n" + ) } // rebuild patches diff --git a/paperweight-lib/src/test/kotlin/io/papermc/paperweight/util/ATTest.kt b/paperweight-lib/src/test/kotlin/io/papermc/paperweight/util/ATTest.kt index 47b488fe8..125f370f3 100644 --- a/paperweight-lib/src/test/kotlin/io/papermc/paperweight/util/ATTest.kt +++ b/paperweight-lib/src/test/kotlin/io/papermc/paperweight/util/ATTest.kt @@ -1,3 +1,25 @@ +/* + * paperweight is a Gradle plugin for the PaperMC project. + * + * Copyright (c) 2023 Kyle Wood (DenWav) + * Contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 only, no later versions. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + package io.papermc.paperweight.util import atFromString