Skip to content

Lint xml output is invalid #14659

@OrangeDog

Description

@OrangeDog

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [x] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No.

Description

As there's no way to specify output to a file (#4959) the only option is to redirect stdout. However, if there are multiple apps the checkstyle (and other formats) generate multiple xml documents.

🔬 Minimal Reproduction

From a new project run

ng lint --format=checkstyle >checkstyle-result.xml

🔥 Exception or Error

The output is invalid, being a concatenation of multiple documents:

<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file name=".../src/environments/environment.ts"></file><file name=".../src/app/app.component.ts"></file><file name=".../src/app/app.module.ts"></file><file name=.../src/main.ts"></file><file name=".../src/polyfills.ts"></file><file name=".../src/test.ts"></file><file name=".../src/app/app.component.spec.ts"></file><file name=".../src/environments/environment.prod.ts"></file></checkstyle>
<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file name=".../e2e/app.po.ts"></file><file name=".../e2e/app.e2e-spec.ts"></file></checkstyle>

🌍 Your Environment


Angular CLI: 8.0.1
Node: 10.15.3
OS: win32 x64
Angular: 8.0.0
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cli                      8.0.1
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions