1

我想在 CI 环境 (Jenkins) 中的 nrwl nx 工作区中对项目进行 lint,生成 checkstyle 格式输出,理想情况下每个 app/lib 一个 checkstyle 文件

使用ng lint > output.file,我得到一个包含多个 xml 的文件:

<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"></checkstyle>
<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file name="../myworkspace/apps/asdf/myapp/src/app/app.component.ts"><error line="4" column="13" severity="error" message="The selector should be kebab-cased and include a dash (https://angular.io/guide/styleguide#style-05-02)" source="failure.tslint.component-selector" /></file></checkstyle>

我必须将此文件拆分为多个 xml 文件以获取有效文件。将文件关联到 app/lib 是困难的或不可能的,因为这只能从失败文件的路径中猜测出来。另外,我不能利用nrwl的nxaffected:lint的并行特性,大大提高了lint速度。

使用yarn affected:lint ... --parallel > output.file起来更加困难,因为这个文件不仅包含上面的 xml 输出,还包含来自 nx.xml 的更多信息。此外(但我还没有验证这一点),我的印象是并行 lints 的输出混淆了。

理想情况下,有一个选项yarn affected:lint --reportToFile可以为每个应用程序和库生成一个输出文件。

4

0 回答 0