Google 检查 eclipse 中出现的问题
Google checks occur issue in eclipse
我在 eclipse 中安装了 checkstyle 插件,并设置 google 默认检查。
然后我制作了一个像这样的 JUnit class。
public class TokenTest {
@Test public void testToken() {
Token tokenWhite = new Token("WHITE");
Token tokenBlack = new Token("BLACK");
assertNotNull("TokenTest-Construct-White", tokenWhite);
assertNotNull("TokenTest-Construct-Black", tokenBlack);
}
}
class 和方法中没有 javadoc 注释。
我使用 google 检查了它。
但是“'method def modifier' 缩进级别 4 不正确,预期级别应为 2。”发生在第 3 列。
并且“'member def type' 有不正确的缩进级别 8,预期级别
应为 4。”,“'method def' child 的缩进级别 8 不正确,预期级别应为 4。”出现在 column4 中。
请帮忙。
谢谢
像这样缩进你的代码
public class TokenTest {
@Test
public void testToken() {
Token tokenWhite = new Token("WHITE");
Token tokenBlack = new Token("BLACK");
assertNotNull("TokenTest-Construct-White", tokenWhite);
assertNotNull("TokenTest-Construct-Black", tokenBlack);
}
}
我在 eclipse 中安装了 checkstyle 插件,并设置 google 默认检查。
然后我制作了一个像这样的 JUnit class。
public class TokenTest {
@Test public void testToken() {
Token tokenWhite = new Token("WHITE");
Token tokenBlack = new Token("BLACK");
assertNotNull("TokenTest-Construct-White", tokenWhite);
assertNotNull("TokenTest-Construct-Black", tokenBlack);
}
}
class 和方法中没有 javadoc 注释。
我使用 google 检查了它。
但是“'method def modifier' 缩进级别 4 不正确,预期级别应为 2。”发生在第 3 列。 并且“'member def type' 有不正确的缩进级别 8,预期级别 应为 4。”,“'method def' child 的缩进级别 8 不正确,预期级别应为 4。”出现在 column4 中。 请帮忙。 谢谢
像这样缩进你的代码
public class TokenTest {
@Test
public void testToken() {
Token tokenWhite = new Token("WHITE");
Token tokenBlack = new Token("BLACK");
assertNotNull("TokenTest-Construct-White", tokenWhite);
assertNotNull("TokenTest-Construct-Black", tokenBlack);
}
}