Checkstyle - 排除文件夹 [英] Checkstyle - Exclude folder

查看:1580
本文介绍了Checkstyle - 排除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的checkstyle报告中忽略一个特定的文件夹(名为generated-sources),因为它们是生成的。

I want to ignore a specific folder (named generated-sources) from my checkstyle reports, because they are generated.

我使用eclipse-cs来显示我的违规行为。

I'm using eclipse-cs for displaying my violations.

我向我的xml添加了一个suppressfilter:

i added a suppressionfilter to my xml:

<module name="SuppressionFilter">
    <property name="file" value=".\suppressions.xml"/>
</module>

我的suppressions.xml如下所示:

my suppressions.xml looks like this:

<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>
    <suppress files="\*generated-sources\*\*\.\*" checks="[a-zA-Z0-9]*"/>
</suppressions>

但它不工作。任何想法?

but it is not working. any ideas?

推荐答案

<suppress files="[\\/]generated-sources[\\/]" checks="[a-zA-Z0-9]*"/>

此作品:)

这篇关于Checkstyle - 排除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆