X Tutup
Skip to content

Commit f1e5b5b

Browse files
Merge pull request #53 from NateIsStalling/spotless
Spotless & Linting
2 parents 3f264f4 + 22ba084 commit f1e5b5b

File tree

234 files changed

+34427
-24548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+34427
-24548
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id "application"
3+
id("com.diffplug.spotless") version "7.0.2"
34
}
45
apply plugin: "java"
56

@@ -58,7 +59,6 @@ startScripts {
5859
classpath = ((Jar)jar).outputs.files + ((Jar)pathingJar).outputs.files
5960
}
6061

61-
6262
dependencies {
6363
implementation fileTree(dir: "libs", include: ["*.jar"])
6464

@@ -91,6 +91,22 @@ dependencies {
9191
testImplementation 'junit:junit:4.12'
9292
}
9393

94+
spotless {
95+
java {
96+
// Use the default importOrder configuration
97+
importOrder()
98+
99+
removeUnusedImports()
100+
palantirJavaFormat('2.50.0').formatJavadoc(false)
101+
102+
formatAnnotations()
103+
trimTrailingWhitespace()
104+
endWithNewline()
105+
}
106+
}
107+
108+
build.dependsOn spotlessApply
109+
94110
jar {
95111
dependsOn(pathingJar)
96112
from { ((Jar)pathingJar).outputs.files.collect { it.isDirectory() ? it : zipTree(it) } }
@@ -130,8 +146,4 @@ task debugAll {
130146
rootProject.ext.get("debugServerJarPath")
131147
}
132148
}
133-
}
134-
135-
repositories {
136-
mavenCentral()
137-
}
149+
}

app/src/main/java/com/basic4gl/desktop/AboutDialog.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
package com.basic4gl.desktop;
22

33
import com.basic4gl.desktop.util.SwingIconUtil;
4-
5-
import javax.swing.*;
6-
import javax.swing.border.EmptyBorder;
74
import java.awt.*;
85
import java.io.IOException;
96
import java.util.Locale;
107
import java.util.ResourceBundle;
8+
import javax.swing.*;
9+
import javax.swing.border.EmptyBorder;
1110

1211
/**
1312
* Created by Nate on 1/12/2015.
1413
*/
1514
public class AboutDialog {
16-
JDialog mDialog;
15+
private final JDialog dialog;
1716

1817
public AboutDialog(Frame parent) {
1918
Locale locale = new Locale("en", "US");
2019
ResourceBundle resources = ResourceBundle.getBundle("build", locale);
2120

22-
mDialog = new JDialog(parent);
21+
dialog = new JDialog(parent);
2322

24-
mDialog.setTitle("About");
23+
dialog.setTitle("About");
2524

26-
mDialog.setResizable(false);
27-
mDialog.setModal(true);
25+
dialog.setResizable(false);
26+
dialog.setModal(true);
2827

2928
JPanel mainPanel = new JPanel();
30-
mDialog.add(mainPanel);
29+
dialog.add(mainPanel);
3130
GridLayout mainLayout = new GridLayout(2, 1);
3231
mainPanel.setLayout(mainLayout);
3332

@@ -50,12 +49,12 @@ public AboutDialog(Frame parent) {
5049
labelDescription.setBorder(new EmptyBorder(5, 5, 5, 5));
5150
descriptionPanel.add(labelDescription);
5251
descriptionPanel.add(new JLabel("Version: " + resources.getString(BuildInfo.APPLICATION_VERSION_RESOURCE)));
53-
descriptionPanel.add(new JLabel("Build Date: " + resources.getString(BuildInfo.APPLICATION_BUILD_DATE_RESOURCE)));
52+
descriptionPanel.add(
53+
new JLabel("Build Date: " + resources.getString(BuildInfo.APPLICATION_BUILD_DATE_RESOURCE)));
5454
descriptionPanel.add(Box.createVerticalGlue());
5555
descriptionPanel.add(new JLabel(BuildInfo.APPLICATION_COPYRIGHT));
5656
descriptionPanel.add(new JLabel(BuildInfo.APPLICATION_WEBSITE));
5757

58-
5958
JTextPane textLicenses = new JTextPane();
6059
JScrollPane scrollLicenses = new JScrollPane(textLicenses);
6160
scrollLicenses.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
@@ -72,11 +71,10 @@ public AboutDialog(Frame parent) {
7271
System.err.println("Couldn't find file: about.html");
7372
}
7473
mainPanel.add(scrollLicenses);
75-
//JScrollPane scrollPane = new ScrollPane(textLicenses);
76-
mDialog.pack();
77-
mDialog.setSize(new Dimension(360, 320));
78-
mDialog.setLocationRelativeTo(parent);
79-
mDialog.setVisible(true);
74+
// JScrollPane scrollPane = new ScrollPane(textLicenses);
75+
dialog.pack();
76+
dialog.setSize(new Dimension(360, 320));
77+
dialog.setLocationRelativeTo(parent);
78+
dialog.setVisible(true);
8079
}
81-
8280
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.basic4gl.desktop;
22

33
enum ApMode {
4-
AP_CLOSED, AP_STOPPED, AP_PAUSED, AP_RUNNING
4+
AP_CLOSED,
5+
AP_STOPPED,
6+
AP_PAUSED,
7+
AP_RUNNING
58
}

0 commit comments

Comments
 (0)
X Tutup