如何仅在增量代码上运行Maven Checkstyle插件 [英] How to run maven checkstyle plugin on incremental code only

查看:69
本文介绍了如何仅在增量代码上运行Maven Checkstyle插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向我们的应用程序添加自动代码审查功能.当前,我们使用Maven进行构建.我遇到了maven checkstyle插件,但希望它仅在添加的增量代码上运行,而不在较旧的代码上运行.我可以使用这个插件来实现吗?如果是,那么请提供有关操作方法的提示?

I want to add auto code review feature to our application. Currently we use maven to do builds. I came across maven checkstyle plugin but want this to run it only on incremental code that gets added and not on older one. Can i achieve this using this plugin? If yes then please provide pointers on how to do it?

推荐答案

Checkstyle插件不知道哪些文件已修改或新建.将增量样式添加到项目的唯一方法是使用配置,手动放置新文件/软件包等.这是用逗号分隔的模式列表.

Checkstyle plugin has no idea what files are modified or new. The only way of incrementally adding checkstyle to a project would be using includes configuration, manually putting new files/packages etc. It's a comma separated list of patterns.

        <executions>
            <execution>
                <id>checkstyle-verify</id>
                <phase>verify</phase>
                <goals>
                    <goal>check</goal>
                </goals>
                <configuration>
                    <includes>NewClass.java,AnotherClass.java</includes>
                </configuration>
            </execution>
        </executions>

这篇关于如何仅在增量代码上运行Maven Checkstyle插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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