如何避免“行长度超过 80 个字符”对于我的 SVN 嵌入 $Id$ 属性?
这是我的 foo.java
文件:
/**
* LICENSE blah-blah-blah
* @Version $Id$
*/
public class Foo {
}
这是 svn update
后文件的样子:
/**
* LICENSE blah-blah-blah
* @Version $Id: Foo.java 396 2010-10-14 06:31:27Z [email protected] $
*/
public class Foo {
}
第 3 行的长度超过 80 个字符,我无能为力有了这个,因为该值是由 SVN 嵌入的。 maven-checkstyle-plugin
抱怨:
Foo.java:3: Line is longer than 80 characters.
我能用这个做些什么吗?我可以教 checkstyle
忽略这一特定行吗?
This is my foo.java
file:
/**
* LICENSE blah-blah-blah
* @Version $Id$
*/
public class Foo {
}
This is how the file looks after svn update
:
/**
* LICENSE blah-blah-blah
* @Version $Id: Foo.java 396 2010-10-14 06:31:27Z [email protected] $
*/
public class Foo {
}
The length of line no.3 is over 80 characters and I can't do anything with this, since the value is embedded by SVN. maven-checkstyle-plugin
complains with:
Foo.java:3: Line is longer than 80 characters.
Is there anything I can do with this? Can I teach checkstyle
to ignore just this particular line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将
ignorePattern
添加到 Checkstyle Checker 配置文件中的LineLength
模块,以便它忽略包含版本信息的行。You can add an
ignorePattern
to theLineLength
module in your Checkstyle Checker configuration file so that it ignores the line containing version information.在文档中,可以忽略具有特定模式的行。所以这可以解决你的问题。
In the documentation there is it possible to ignore lines with a particular pattern. So this would solve your problem.