Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Fix spotless (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoswitch authored Mar 13, 2022
1 parent a62de17 commit af1a449
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ public Map<String, String> getContentFormat() {
return result;
}

/** @return The content type. */
/**
* @return The content type.
*/
@Override
public String getContentType() {
return CONTENT_TYPE + "; charset=" + this.getCharset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ public interface GraphImage {

/** The location the caption was taken. */
@JsonProperty("location")
@Nullable
Location getLocation();
@Nullable Location getLocation();
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pluginManagement {

plugins {
id("com.gradle.enterprise").version("3.6.3")
id("org.curioswitch.gradle-curiostack-plugin").version("0.9.0")
id("org.curioswitch.gradle-curiostack-plugin").version("0.9.1")
}

configure<CuriostackExtension> {
Expand Down
44 changes: 21 additions & 23 deletions tools/golang-test/main.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
/*
* MIT License
*
* Copyright (c) 2018 Choko (choko@curioswitch.org)
*
* 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.
*/
// MIT License
//
// Copyright (c) 2018 Choko (choko@curioswitch.org)
//
// 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.

package main

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
version=0.9.0
version=0.9.1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static net.ltgt.gradle.errorprone.CheckSeverity.WARN;

import com.diffplug.gradle.spotless.SpotlessExtension;
import com.diffplug.gradle.spotless.SpotlessExtensionPredeclare;
import com.diffplug.gradle.spotless.SpotlessPlugin;
import com.github.benmanes.gradle.versions.VersionsPlugin;
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask;
Expand Down Expand Up @@ -269,6 +270,9 @@ public void apply(Project rootProject) {
plugins.apply(TerraformSetupPlugin.class);
plugins.apply(ToolDownloaderPlugin.class);

rootProject.getRepositories().mavenCentral();
rootProject.getRepositories().mavenLocal();

var updateGradleWrapper =
rootProject.getTasks().register("curioUpdateWrapper", UpdateGradleWrapperTask.class);

Expand Down Expand Up @@ -757,6 +761,21 @@ private static void setupSpotless(Project rootProject) {
.map(line -> line.isEmpty() ? "#" : "# " + line)
.collect(Collectors.joining("\n", "", "\n\n"));

rootProject.getPlugins().apply(SpotlessPlugin.class);
rootProject
.getExtensions()
.configure(SpotlessExtension.class, SpotlessExtension::predeclareDeps);
rootProject
.getExtensions()
.configure(
SpotlessExtensionPredeclare.class,
spotless -> {
spotless.java(
java ->
java.googleJavaFormat(
ToolDependencies.getGoogleJavaFormatVersion(rootProject)));
});

rootProject.subprojects(
project -> {
// Don't apply spotless to intermediate projects, CurioStack currently doesn't have a use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ToolDependencies {
.put("claat", "2.2.0")
.put("gcloud", "351.0.0")
.put("golang", "1.16.7")
.put("google-java-format", "1.11.0")
.put("google-java-format", "1.15.0")
.put("gradle", "7.4.1")
.put("miniconda", "Miniconda3-py39_4.10.3")
.put("node", "14.17.4")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
/*
* MIT License
*
* Copyright (c) 2019 Choko (choko@curioswitch.org)
*
* 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.
*/
// MIT License
//
// Copyright (c) 2019 Choko (choko@curioswitch.org)
//
// 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.

package main

Expand Down

0 comments on commit af1a449

Please sign in to comment.