Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Commit

Permalink
✨ lint with spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Feb 17, 2023
1 parent 5772cb0 commit cdca64e
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package org.noelware.infra.gradle.plugins.module;

import com.diffplug.gradle.spotless.SpotlessExtension;
import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import org.gradle.api.GradleException;
Expand Down Expand Up @@ -58,18 +57,19 @@ public void apply(@NotNull Project project) {
project.getExtensions().configure(SpotlessExtension.class, (spotless) -> {
spotless.java((java) -> {
try {
java.licenseHeader(ext.getLicense().getOrElse(Licenses.MIT).getTemplate(
ext.getProjectName()
.getOrElse(project.getRootProject().getName()),
ext.getProjectDescription()
.getOrElse(
project.getDescription() != null
? project.getDescription()
: "fill this out"),
ext.getCurrentYear()
.getOrElse(String.valueOf(
Calendar.getInstance().get(Calendar.YEAR)))
));
java.licenseHeader(ext.getLicense()
.getOrElse(Licenses.MIT)
.getTemplate(
ext.getProjectName()
.getOrElse(project.getRootProject().getName()),
ext.getProjectDescription()
.getOrElse(
project.getDescription() != null
? project.getDescription()
: "fill this out"),
ext.getCurrentYear()
.getOrElse(String.valueOf(
Calendar.getInstance().get(Calendar.YEAR)))));

java.trimTrailingWhitespace();
java.removeUnusedImports();
Expand Down

0 comments on commit cdca64e

Please sign in to comment.