Skip to content

Commit

Permalink
Revert "Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608)" (#9667
Browse files Browse the repository at this point in the history
)

This reverts commit 208fb0f.
  • Loading branch information
platinumazure committed Nov 30, 2017
1 parent f4a65c6 commit 1e362a0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/formatters/checkstyle.js
Expand Up @@ -32,7 +32,7 @@ module.exports = function(results) {

let output = "";

output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>";
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
output += "<checkstyle version=\"4.3\">";

results.forEach(result => {
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/jslint-xml.js
Expand Up @@ -14,7 +14,7 @@ module.exports = function(results) {

let output = "";

output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>";
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
output += "<jslint>";

results.forEach(result => {
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/junit.js
Expand Up @@ -32,7 +32,7 @@ module.exports = function(results) {

let output = "";

output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>\n";
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
output += "<testsuites>\n";

results.forEach(result => {
Expand Down
14 changes: 7 additions & 7 deletions tests/lib/formatters/checkstyle.js
Expand Up @@ -32,14 +32,14 @@ describe("formatter:checkstyle", () => {
it("should return a string in the format filename: line x, col y, Error - z for errors", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
});

it("should return a string in the format filename: line x, col y, Warning - z for warnings", () => {
code[0].messages[0].severity = 1;
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"warning\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"warning\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
});
});

Expand All @@ -58,7 +58,7 @@ describe("formatter:checkstyle", () => {
it("should return a string in the format filename: line x, col y, Error - z", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"&lt;&gt;&amp;&quot;&apos;.js\"><error line=\"&lt;\" column=\"&gt;\" severity=\"error\" message=\"Unexpected &lt;&gt;&amp;&quot;&apos;&#8;&#9;&#10;&#12;&#13;&#29275;&#36924;. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"&lt;&gt;&amp;&quot;&apos;.js\"><error line=\"&lt;\" column=\"&gt;\" severity=\"error\" message=\"Unexpected &lt;&gt;&amp;&quot;&apos;&#8;&#9;&#10;&#12;&#13;&#29275;&#36924;. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
});
});

Expand All @@ -77,7 +77,7 @@ describe("formatter:checkstyle", () => {
it("should return a string in the format filename: line x, col y, Error - z", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file></checkstyle>");
});
});

Expand All @@ -102,7 +102,7 @@ describe("formatter:checkstyle", () => {
it("should return a string with multiple entries", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /><error line=\"6\" column=\"11\" severity=\"warning\" message=\"Unexpected bar. (bar)\" source=\"eslint.rules.bar\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /><error line=\"6\" column=\"11\" severity=\"warning\" message=\"Unexpected bar. (bar)\" source=\"eslint.rules.bar\" /></file></checkstyle>");
});
});

Expand Down Expand Up @@ -130,7 +130,7 @@ describe("formatter:checkstyle", () => {
it("should return a string with multiple entries", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file><file name=\"bar.js\"><error line=\"6\" column=\"11\" severity=\"warning\" message=\"Unexpected bar. (bar)\" source=\"eslint.rules.bar\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo. (foo)\" source=\"eslint.rules.foo\" /></file><file name=\"bar.js\"><error line=\"6\" column=\"11\" severity=\"warning\" message=\"Unexpected bar. (bar)\" source=\"eslint.rules.bar\" /></file></checkstyle>");
});
});

Expand All @@ -148,7 +148,7 @@ describe("formatter:checkstyle", () => {
it("should return a string in the format filename: line x, col y, Error - z for errors", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo.\" source=\"\" /></file></checkstyle>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\"><file name=\"foo.js\"><error line=\"5\" column=\"10\" severity=\"error\" message=\"Unexpected foo.\" source=\"\" /></file></checkstyle>");
});
});
});
14 changes: 7 additions & 7 deletions tests/lib/formatters/jslint-xml.js
Expand Up @@ -34,7 +34,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 1 issue in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
});
});

Expand All @@ -55,7 +55,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 1 issue in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
});
});

Expand All @@ -82,7 +82,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 2 issues in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /><issue line=\"6\" char=\"11\" evidence=\"bar\" reason=\"Unexpected bar. (bar)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /><issue line=\"6\" char=\"11\" evidence=\"bar\" reason=\"Unexpected bar. (bar)\" /></file></jslint>");
});
});

Expand Down Expand Up @@ -112,7 +112,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 2 issues in 2 files", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file><file name=\"bar.js\"><issue line=\"6\" char=\"11\" evidence=\"bar\" reason=\"Unexpected bar. (bar)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected foo. (foo)\" /></file><file name=\"bar.js\"><issue line=\"6\" char=\"11\" evidence=\"bar\" reason=\"Unexpected bar. (bar)\" /></file></jslint>");
});
});

Expand All @@ -133,7 +133,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 1 issue in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected &lt;&amp;&quot;&apos;&gt;&#8;&#9;&#10;&#12;&#13;&#29275;&#36924; foo. (foo)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"foo\" reason=\"Unexpected &lt;&amp;&quot;&apos;&gt;&#8;&#9;&#10;&#12;&#13;&#29275;&#36924; foo. (foo)\" /></file></jslint>");
});
});

Expand All @@ -153,7 +153,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 1 issue in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"\" reason=\"Unexpected foo. (foo)\" /></file></jslint>");
});
});

Expand All @@ -170,7 +170,7 @@ describe("formatter:jslint-xml", () => {
it("should return a string in JSLint XML format with 1 issue in 1 file", () => {
const result = formatter(code);

assert.strictEqual(result, "<?xml version=\"1.1\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"\" reason=\"\" /></file></jslint>");
assert.strictEqual(result, "<?xml version=\"1.0\" encoding=\"utf-8\"?><jslint><file name=\"foo.js\"><issue line=\"5\" char=\"10\" evidence=\"\" reason=\"\" /></file></jslint>");
});
});
});

0 comments on commit 1e362a0

Please sign in to comment.