我的 build.xml 中有以下目标,准备由 Phing 处理:
<target name="syntax-test">
<exec command="git diff --cached --name-only --diff-filter=ACMRTUXB" dir="./" escape="false" output="${TMP_DIR}/changed_files" />
<fileset id="CHANGED_FILES" dir="./" includesfile="${TMP_DIR}/changed_files" />
</exec>
<phplint haltonfailure="true" level="warning" deprecatedAsError="true">
<fileset refid="CHANGED_FILES" />
</phplint>
</target>
因为我有很多工具,我只想在所有文件的一小部分上运行 - 只在那些被添加/修改/等的文件上,我需要过滤这些。
这工作正常。
每个工具都非常具体,可用于仅检查特定文件(例如用于检查.php的phplint或用于检查.xml的xmllint)。
我如何过滤掉这些?
当我尝试应用模式集或包含时,它似乎被迫只使用新规则(忽略包含文件参数)。