Skip to content

Commit

Permalink
Remove all wildcard imports (#6377)
Browse files Browse the repository at this point in the history
* Remove all wildcard imports

* Throw exception for future wildcard imports
Automatically expanding these to single-line imports would be great, but is still out of reach for the time being.

* Attribution for custom spotless rule
  • Loading branch information
62832 authored Jun 19, 2022
1 parent cc207e1 commit 0737479
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 11 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,15 @@ spotless {
toggleOffOn()
eclipse().configFile 'codeformat/codeformat.xml'
importOrderFile 'codeformat/ae2.importorder'

// courtesy of diffplug/spotless#240
// https://github.com/diffplug/spotless/issues/240#issuecomment-385206606
custom 'noWildcardImports', {
if (it.contains('*;\n')) {
throw new Error('No wildcard imports allowed')
}
}
bumpThisNumberIfACustomStepChanges(1)
}

format 'json', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
import net.minecraft.util.Mth;

import appeng.client.Point;
import appeng.client.gui.*;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.ICompositeWidget;
import appeng.client.gui.MathExpressionParser;
import appeng.client.gui.NumberEntryType;
import appeng.client.gui.Rects;
import appeng.client.gui.style.WidgetStyle;
import appeng.core.localization.GuiText;

Expand Down
22 changes: 21 additions & 1 deletion src/main/java/appeng/client/gui/widgets/SettingToggleButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,27 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;

import appeng.api.config.*;
import appeng.api.config.AccessRestriction;
import appeng.api.config.CondenserOutput;
import appeng.api.config.CpuSelectionMode;
import appeng.api.config.FullnessMode;
import appeng.api.config.FuzzyMode;
import appeng.api.config.OperationMode;
import appeng.api.config.PowerUnits;
import appeng.api.config.RedstoneMode;
import appeng.api.config.RelativeDirection;
import appeng.api.config.SchedulingMode;
import appeng.api.config.SearchBoxMode;
import appeng.api.config.Setting;
import appeng.api.config.Settings;
import appeng.api.config.ShowPatternProviders;
import appeng.api.config.SortDir;
import appeng.api.config.SortOrder;
import appeng.api.config.StorageFilter;
import appeng.api.config.TerminalStyle;
import appeng.api.config.TypeFilter;
import appeng.api.config.ViewItems;
import appeng.api.config.YesNo;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.Icon;
import appeng.core.definitions.AEParts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

package appeng.client.render.cablebus;

import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.Supplier;

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/appeng/core/definitions/AEBlockEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
import appeng.blockentity.spatial.SpatialAnchorBlockEntity;
import appeng.blockentity.spatial.SpatialIOPortBlockEntity;
import appeng.blockentity.spatial.SpatialPylonBlockEntity;
import appeng.blockentity.storage.*;
import appeng.blockentity.storage.ChestBlockEntity;
import appeng.blockentity.storage.DriveBlockEntity;
import appeng.blockentity.storage.IOPortBlockEntity;
import appeng.blockentity.storage.SkyChestBlockEntity;
import appeng.blockentity.storage.SkyStoneTankBlockEntity;
import appeng.core.AppEng;
import appeng.debug.ChunkLoaderBlockEntity;
import appeng.debug.CubeGeneratorBlockEntity;
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/appeng/core/definitions/AEParts.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
import appeng.items.parts.ColoredPartItem;
import appeng.items.parts.PartItem;
import appeng.items.parts.PartModelsHelper;
import appeng.parts.automation.*;
import appeng.parts.automation.AnnihilationPlanePart;
import appeng.parts.automation.AnnihilationPlanePartItem;
import appeng.parts.automation.EnergyLevelEmitterPart;
import appeng.parts.automation.ExportBusPart;
import appeng.parts.automation.FormationPlanePart;
import appeng.parts.automation.ImportBusPart;
import appeng.parts.automation.StorageLevelEmitterPart;
import appeng.parts.crafting.PatternProviderPart;
import appeng.parts.encoding.PatternEncodingTerminalPart;
import appeng.parts.misc.CableAnchorPart;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/appeng/core/localization/Tooltips.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import org.jetbrains.annotations.NotNull;

import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.*;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextColor;
import net.minecraft.world.item.ItemStack;

import appeng.api.config.PowerUnits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
import appeng.blockentity.networking.CableBusTESR;
import appeng.client.render.crafting.CraftingMonitorRenderer;
import appeng.client.render.crafting.MolecularAssemblerRenderer;
import appeng.client.render.tesr.*;
import appeng.client.render.tesr.ChargerBlockEntityRenderer;
import appeng.client.render.tesr.ChestBlockEntityRenderer;
import appeng.client.render.tesr.DriveLedBlockEntityRenderer;
import appeng.client.render.tesr.InscriberTESR;
import appeng.client.render.tesr.SkyChestTESR;
import appeng.client.render.tesr.SkyCompassTESR;
import appeng.client.render.tesr.SkyStoneTankBlockEntityRenderer;
import appeng.core.definitions.AEBlockEntities;

@Environment(EnvType.CLIENT)
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/appeng/util/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
package appeng.util;

import java.text.DecimalFormat;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

import com.google.common.base.Strings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
import appeng.api.crafting.IPatternDetails;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.*;
import appeng.api.networking.crafting.CalculationStrategy;
import appeng.api.networking.crafting.ICraftingCPU;
import appeng.api.networking.crafting.ICraftingLink;
import appeng.api.networking.crafting.ICraftingPlan;
import appeng.api.networking.crafting.ICraftingRequester;
import appeng.api.networking.crafting.ICraftingService;
import appeng.api.networking.crafting.ICraftingSimulationRequester;
import appeng.api.networking.security.IActionSource;
import appeng.api.networking.storage.IStorageService;
import appeng.api.stacks.AEKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package appeng.me.service.helpers;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.List;
import java.util.Set;
Expand Down

0 comments on commit 0737479

Please sign in to comment.