Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608)" #9667

Merged
merged 1 commit into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/formatters/checkstyle.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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>");
});
});
});