Skip to content

Run Checkstyle on Travis #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ deploy:
branch: master
tags: true
script:
- ./gradlew clean test
- ./gradlew clean check
1 change: 0 additions & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package com.neueda.jetbrains.plugin.graphdb.language.cypher.editor;

import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.lang.parameterInfo.CreateParameterInfoContext;
import com.intellij.lang.parameterInfo.ParameterInfoContext;
import com.intellij.lang.parameterInfo.ParameterInfoHandlerWithTabActionSupport;
import com.intellij.lang.parameterInfo.ParameterInfoUIContext;
import com.intellij.lang.parameterInfo.ParameterInfoUtils;
import com.intellij.lang.parameterInfo.UpdateParameterInfoContext;
import com.intellij.lang.parameterInfo.*;
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
Expand All @@ -20,7 +15,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Objects;
import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ private void setupEditor(Project project) {
}

private void setupFileSpecificEditor(Project project, VirtualFile cypherFile) {
if (project == null || cypherFile == null) return;
if (project == null || cypherFile == null) {
return;
}
try {
String params = FileUtil.getParams(cypherFile);
LightVirtualFile lightVirtualFile = new LightVirtualFile("", JsonFileType.INSTANCE, params);
Expand All @@ -129,8 +131,9 @@ private void setupFileSpecificEditor(Project project, VirtualFile cypherFile) {
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileListener() {
@Override
public void contentsChanged(@NotNull VirtualFileEvent event) {
if (event.getFile().equals(cypherFile) && document != null)
if (event.getFile().equals(cypherFile) && document != null) {
FileUtil.setParams(cypherFile, document.getText());
}
}
});
JLabel jLabel = new JLabel("<html>Parameters for data source <b>" +
Expand All @@ -139,7 +142,9 @@ public void contentsChanged(@NotNull VirtualFileEvent event) {
jLabel.setToolTipText("Enter parameters in JSON format. Will be applied to <b>" + getTabTitle(cypherFile) +
"</b> data source when executed");
fileSpecificParamEditor.setHeaderComponent(jLabel);
if (document != null) setInitialContent(document);
if (document != null) {
setInitialContent(document);
}
graphConsoleView.getFileSpecificParametersTab().add(fileSpecificParamEditor.getComponent(), BorderLayout.CENTER);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public Map<String, Object> getParameters(PsiElement element) throws Exception {
Map<String, Object> allParameters = new HashMap<>();
if (isValidParametersMap(parametersProvider.getFileSpecificParametersJson())) {
Map<String, Object> parsedFileSpecific = MAPPER.readValue(parametersProvider.getFileSpecificParametersJson(),
new TypeReference<Map<String, Object>>() {});
new TypeReference<Map<String, Object>>() {
});
parsedFileSpecific.forEach(allParameters::putIfAbsent);
}
if (isValidParametersMap(parametersProvider.getGlobalParametersJson())) {
Map<String, Object> parsedGlobal = MAPPER.readValue(parametersProvider.getGlobalParametersJson(),
new TypeReference<Map<String, Object>>() {});
new TypeReference<Map<String, Object>>() {
});
parsedGlobal.forEach(allParameters::putIfAbsent);
}
return extractQueryParameters(element, allParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static void setParams(VirtualFile file, String params) {
if (file instanceof NewVirtualFile) {
try (DataOutputStream os = QUERY_PARAMS_FILE_ATTRIBUTE.writeAttribute(file)) {
IOUtil.writeString(StringUtil.notNullize(params), os);
} catch (IOException e) {}
} catch (IOException e) {
}
}
}

Expand Down