Skip to content

Checkstyle produces invalid xml if rustfmt failed #1635

@ahal

Description

@ahal

STR
Find a file with a line that's too long:
$ rustfmt --write-mode=checkstyle file.rs

...
<error line="1624" severity="warning" message="Should be `                   .clone())`" /><error line="1633" severity="warning" message="Should be `                   .clone())`" /><error line="1664" severity="warning" message="Should be `            Nullable::Value(ref x) =&gt; Json::Object(try!(x.to_marionette())),`" /><error line="1684" severity="warning" message="Should be `        Ok(try_opt!(self.to_json().as_object(),`" /><error line="1684" severity="warning" message="Should be `                    ErrorStatus::UnknownError,`" /><error line="1684Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/prefs.rs:114: line exceeded maximum length (maximum: 100, found: 112) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/prefs.rs:115: line exceeded maximum length (maximum: 100, found: 109) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/marionette.rs:540: line exceeded maximum length (maximum: 100, found: 122) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/marionette.rs:658: line exceeded maximum length (maximum: 100, found: 119) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/marionette.rs:1442: line exceeded maximum length (maximum: 100, found: 108) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/capabilities.rs:224: line exceeded maximum length (maximum: 100, found: 122) (sorry)
Rustfmt failed at /home/ahal/hg/mozilla-central/testing/geckodriver/src/capabilities.rs:229: line exceeded maximum length (maximum: 100, found: 105) (sorry)
" severity="warning" message="Should be `                    &quot;Expected an object&quot;)`" /><error line="1684" severity="warning" message="Should be `                   .clone())`" /><error line="1696" severity="warning" message="Should be `            FrameId::Element(ref x) =&gt; {`" /><error line="1696" severity="warning" message="Should be `                data.insert(&quot;element&quot;.to_string(), Json::Object(try!(x.to_marionette())))`" /><error line="1696" severity="warning" message="Should be `            }`" /><error line="1696" severity="warning" message="Should be `            FrameId::Null =&gt; None,`" /></file><file name="/home/ahal/hg/mozilla-central/testing/geckodriver/src/prefs.rs"></file></checkstyle>

The "Rustfmt failed" messages seem to get printed right in the middle of the last "error" tag, causing the xml parser to fail. Ideally stuff like "line too long" would be incorporated into the xml tree, but at the very least would be nice if they got dumped at the end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEP-lowLow prioritywont-fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions