Skip to content

Commit 209a41c

Browse files
committed
Reformat almost all code according to XDEV standards
1 parent 07d94ec commit 209a41c

File tree

70 files changed

+4069
-3507
lines changed

Some content is hidden

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

70 files changed

+4069
-3507
lines changed

.config/checkstyle/suppressions.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6+
<suppress files="[\\/]src[\\/]test[\\/]resources[\\/].*\.java$" checks=".*"/>
7+
<suppress
8+
files="[\\/]src[\\/]main[\\/]java[\\/]software[\\/]xdev[\\/]saveactions[\\/].*CustomAccessCanBeTightenedInspection\.java$"
9+
checks=".*"/>
10+
<suppress files="[\\/]src[\\/]test[\\/]java[\\/].*\.java$" checks="MethodName"/>
611
</suppressions>

.idea/checkstyle-idea.xml

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

.idea/codeStyles/Project.xml

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

.idea/codeStyles/codeStyleConfig.xml

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

src/main/java/software/xdev/saveactions/core/ExecutionMode.java

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,32 @@
33
import com.intellij.openapi.editor.Document;
44
import com.intellij.openapi.fileEditor.FileDocumentManager;
55

6-
public enum ExecutionMode {
7-
8-
/**
9-
* When the plugin is called normally (the IDE calls the plugin component on frame deactivation or "save all"). The
10-
* {@link #saveSingle} is also called on every document.
11-
*
12-
* @see FileDocumentManager#saveAllDocuments()
13-
*/
14-
saveAll,
15-
16-
/**
17-
* When the plugin is called only with a single save (some other plugins like ideavim do that).
18-
*
19-
* @see FileDocumentManager#saveDocument(Document)
20-
*/
21-
saveSingle,
22-
23-
/**
24-
* When the plugin is called in batch mode (the IDE calls the plugin after a file selection popup).
25-
*/
26-
batch,
27-
28-
/**
29-
* When the plugin is called from a user input shortcut.
30-
*/
31-
shortcut,
326

7+
public enum ExecutionMode
8+
{
9+
10+
/**
11+
* When the plugin is called normally (the IDE calls the plugin component on frame deactivation or "save all"). The
12+
* {@link #saveSingle} is also called on every document.
13+
*
14+
* @see FileDocumentManager#saveAllDocuments()
15+
*/
16+
saveAll,
17+
18+
/**
19+
* When the plugin is called only with a single save (some other plugins like ideavim do that).
20+
*
21+
* @see FileDocumentManager#saveDocument(Document)
22+
*/
23+
saveSingle,
24+
25+
/**
26+
* When the plugin is called in batch mode (the IDE calls the plugin after a file selection popup).
27+
*/
28+
batch,
29+
30+
/**
31+
* When the plugin is called from a user input shortcut.
32+
*/
33+
shortcut,
3334
}
Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,59 @@
11
package software.xdev.saveactions.core.action;
22

3-
import software.xdev.saveactions.core.service.SaveActionsService;
4-
import software.xdev.saveactions.core.service.SaveActionsServiceManager;
3+
import static java.util.Collections.synchronizedSet;
4+
import static software.xdev.saveactions.core.ExecutionMode.batch;
5+
import static software.xdev.saveactions.model.Action.activateOnBatch;
6+
7+
import java.util.HashSet;
8+
import java.util.Set;
9+
10+
import org.jetbrains.annotations.NotNull;
11+
512
import com.intellij.analysis.AnalysisScope;
613
import com.intellij.analysis.BaseAnalysisAction;
714
import com.intellij.openapi.diagnostic.Logger;
815
import com.intellij.openapi.project.Project;
916
import com.intellij.psi.PsiElementVisitor;
1017
import com.intellij.psi.PsiFile;
11-
import org.jetbrains.annotations.NotNull;
12-
import software.xdev.saveactions.model.Action;
1318

14-
import java.util.HashSet;
15-
import java.util.Set;
19+
import software.xdev.saveactions.core.service.SaveActionsService;
20+
import software.xdev.saveactions.core.service.SaveActionsServiceManager;
21+
import software.xdev.saveactions.model.Action;
1622

17-
import static software.xdev.saveactions.core.ExecutionMode.batch;
18-
import static software.xdev.saveactions.model.Action.activateOnBatch;
19-
import static java.util.Collections.synchronizedSet;
2023

2124
/**
22-
* This action runs the save actions on the given scope of files, only if property
23-
* {@link Action#activateOnShortcut} is enabled. The user is asked for the scope using a standard
24-
* IDEA dialog. It delegates to {@link SaveActionsService}. Originally based on
25-
* {@link com.intellij.codeInspection.inferNullity.InferNullityAnnotationsAction}.
25+
* This action runs the save actions on the given scope of files, only if property {@link Action#activateOnShortcut} is
26+
* enabled. The user is asked for the scope using a standard IDEA dialog. It delegates to {@link SaveActionsService}.
27+
* Originally based on {@link com.intellij.codeInspection.inferNullity.InferNullityAnnotationsAction}.
2628
*
2729
* @author markiewb
2830
* @see SaveActionsServiceManager
2931
*/
30-
public class BatchAction extends BaseAnalysisAction {
31-
32-
private static final Logger LOGGER = Logger.getInstance(SaveActionsService.class);
33-
private static final String COMPONENT_NAME = "Save Actions";
34-
35-
public BatchAction() {
36-
super(COMPONENT_NAME, COMPONENT_NAME);
37-
}
38-
39-
@Override
40-
protected void analyze(@NotNull Project project, @NotNull AnalysisScope scope) {
41-
LOGGER.info("[+] Start BatchAction#analyze with project " + project + " and scope " + scope);
42-
Set<PsiFile> psiFiles = synchronizedSet(new HashSet<>());
43-
scope.accept(new PsiElementVisitor() {
44-
@Override
45-
public void visitFile(PsiFile psiFile) {
46-
super.visitFile(psiFile);
47-
psiFiles.add(psiFile);
48-
}
49-
});
50-
SaveActionsServiceManager.getService().guardedProcessPsiFiles(project, psiFiles, activateOnBatch, batch);
51-
LOGGER.info("End BatchAction#analyze processed " + psiFiles.size() + " files");
52-
}
53-
32+
public class BatchAction extends BaseAnalysisAction
33+
{
34+
private static final Logger LOGGER = Logger.getInstance(SaveActionsService.class);
35+
private static final String COMPONENT_NAME = "Save Actions";
36+
37+
public BatchAction()
38+
{
39+
super(COMPONENT_NAME, COMPONENT_NAME);
40+
}
41+
42+
@Override
43+
protected void analyze(@NotNull final Project project, @NotNull final AnalysisScope scope)
44+
{
45+
LOGGER.info("[+] Start BatchAction#analyze with project " + project + " and scope " + scope);
46+
final Set<PsiFile> psiFiles = synchronizedSet(new HashSet<>());
47+
scope.accept(new PsiElementVisitor()
48+
{
49+
@Override
50+
public void visitFile(final PsiFile psiFile)
51+
{
52+
super.visitFile(psiFile);
53+
psiFiles.add(psiFile);
54+
}
55+
});
56+
SaveActionsServiceManager.getService().guardedProcessPsiFiles(project, psiFiles, activateOnBatch, batch);
57+
LOGGER.info("End BatchAction#analyze processed " + psiFiles.size() + " files");
58+
}
5459
}

0 commit comments

Comments
 (0)