Polish "Add gitignore for VS Code"

Closes gh-864
This commit is contained in:
Stephane Nicoll
2019-03-15 11:37:10 +01:00
parent c5f0b835e0
commit 48097295d4
3 changed files with 7 additions and 10 deletions

View File

@@ -39,22 +39,20 @@ public class GitIgnore {
private final GitIgnoreSection netBeans = new GitIgnoreSection("NetBeans");
private final GitIgnoreSection visualStudioCode = new GitIgnoreSection(
"Visual Studio Code");
private final GitIgnoreSection vscode = new GitIgnoreSection("VS Code");
public void write(PrintWriter writer) throws IOException {
this.general.write(writer);
this.sts.write(writer);
this.intellijIdea.write(writer);
this.netBeans.write(writer);
this.visualStudioCode.write(writer);
this.vscode.write(writer);
}
public boolean isEmpty() {
return this.general.getItems().isEmpty() && this.sts.getItems().isEmpty()
&& this.intellijIdea.getItems().isEmpty()
&& this.netBeans.getItems().isEmpty()
&& this.visualStudioCode.getItems().isEmpty();
&& this.netBeans.getItems().isEmpty() && this.vscode.getItems().isEmpty();
}
public GitIgnoreSection getGeneral() {
@@ -73,8 +71,8 @@ public class GitIgnore {
return this.netBeans;
}
public GitIgnoreSection getVisualStudioCode() {
return this.visualStudioCode;
public GitIgnoreSection getVscode() {
return this.vscode;
}
/**

View File

@@ -72,7 +72,7 @@ public class GitProjectGenerationConfiguration {
gitIgnore.getIntellijIdea().add(".idea", "*.iws", "*.iml", "*.ipr");
gitIgnore.getNetBeans().add("/nbproject/private/", "/nbbuild/", "/dist/",
"/nbdist/", "/.nb-gradle/");
gitIgnore.getVisualStudioCode().add(".vscode/");
gitIgnore.getVscode().add(".vscode/");
return gitIgnore;
}

View File

@@ -61,8 +61,7 @@ class GitProjectGenerationConfigurationTests {
ProjectDescription description = new ProjectDescription();
description.setBuildSystem(new GradleBuildSystem());
assertThat(generateGitIgnore(description)).contains("### STS ###",
"### IntelliJ IDEA ###", "### NetBeans ###",
"### Visual Studio Code ###");
"### IntelliJ IDEA ###", "### NetBeans ###", "### VS Code ###");
}
@Test