mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Add dangling commas
Ensure multiline object and array litterals are consistenly typed out with dangling commas for the last element.
This commit is contained in:
1 parent
3e4f0b6b5e
commit
8cb21c5fa8
16 files changed
+69
-69
No files matched your search
@@ -114,7 +114,7 @@ describe("Integration of Clusterio", function() {
|
||||
],
|
||||
[
|
||||
"ignore_player_limit_for_returning_players", true,
|
||||
"ignore-player-limit-for-returning-players", "Ignore player limit for returning players: true."
|
||||
"ignore-player-limit-for-returning-players", "Ignore player limit for returning players: true.",
|
||||
],
|
||||
[
|
||||
"max_players", 11,
|
||||
|
||||
+13
-13
@@ -25,35 +25,35 @@ describe("lib/config/classes", function() {
|
||||
for (let [def, error] of [
|
||||
[
|
||||
{ name: "a", type: "invalid", optional: true },
|
||||
"invalid is not a valid type"
|
||||
"invalid is not a valid type",
|
||||
],
|
||||
[
|
||||
{ name: [], type: "string", optional: true },
|
||||
"name must be a string"
|
||||
"name must be a string",
|
||||
],
|
||||
[
|
||||
{ name: "a", type: "string", enum: true, optional: true },
|
||||
"enum must be an array"
|
||||
"enum must be an array",
|
||||
],
|
||||
[
|
||||
{ name: "a", title: 2, type: "string", optional: true },
|
||||
"title must be a string"
|
||||
"title must be a string",
|
||||
],
|
||||
[
|
||||
{ name: "a", description: 2, type: "string", optional: true },
|
||||
"description must be a string"
|
||||
"description must be a string",
|
||||
],
|
||||
[
|
||||
{ name: "a", type: "string", optional: "yes" },
|
||||
"optional must be a boolean"
|
||||
"optional must be a boolean",
|
||||
],
|
||||
[
|
||||
{ name: "a", type: "string", initial_value: 1 },
|
||||
"initial_value must match the type or be a function"
|
||||
"initial_value must match the type or be a function",
|
||||
],
|
||||
[
|
||||
{ name: "a", type: "string" },
|
||||
"Non-optional field a needs an initial_value"
|
||||
"Non-optional field a needs an initial_value",
|
||||
],
|
||||
]) {
|
||||
assert.throws(() => TestGroup.define(def), new Error(error));
|
||||
@@ -477,8 +477,8 @@ describe("lib/config/classes", function() {
|
||||
{
|
||||
name: "beta",
|
||||
fields: { bar: {} },
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -521,7 +521,7 @@ describe("lib/config/classes", function() {
|
||||
{
|
||||
name: "beta",
|
||||
fields: { bar: { value: 20 }},
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
let testInstance = new TestConfig();
|
||||
@@ -543,7 +543,7 @@ describe("lib/config/classes", function() {
|
||||
{
|
||||
name: "beta",
|
||||
fields: { bar: { value: 30 }},
|
||||
}
|
||||
},
|
||||
]}, false);
|
||||
|
||||
assert.deepEqual(testInstance.serialize(), {
|
||||
@@ -559,7 +559,7 @@ describe("lib/config/classes", function() {
|
||||
{
|
||||
name: "beta",
|
||||
fields: { bar: { value: 30 }},
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
+14
-14
@@ -11,7 +11,7 @@ let testLines = new Map([
|
||||
level: "Info",
|
||||
file: "RemoteCommandProcessor.cpp:131",
|
||||
message: "Starting RCON interface at port 4000",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
" 0.622 Warning FileUtil.cpp:527: test not found; using test.zip",
|
||||
@@ -22,7 +22,7 @@ let testLines = new Map([
|
||||
level: "Warning",
|
||||
file: "FileUtil.cpp:527",
|
||||
message: "test not found; using test.zip",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
" 0.554 Error Main.cpp:839: require_user_verification must be enabled for public games.",
|
||||
@@ -33,7 +33,7 @@ let testLines = new Map([
|
||||
level: "Error",
|
||||
file: "Main.cpp:839",
|
||||
message: "require_user_verification must be enabled for public games.",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
" 640.910 Quitting: remote-quit.",
|
||||
@@ -42,7 +42,7 @@ let testLines = new Map([
|
||||
time: "640.910",
|
||||
type: "generic",
|
||||
message: "Quitting: remote-quit.",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"1641.421 Goodbye",
|
||||
@@ -51,7 +51,7 @@ let testLines = new Map([
|
||||
time: "1641.421",
|
||||
type: "generic",
|
||||
message: "Goodbye",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"2019-01-20 10:30:04 [JOIN] User joined the game",
|
||||
@@ -61,7 +61,7 @@ let testLines = new Map([
|
||||
type: "action",
|
||||
action: "JOIN",
|
||||
message: "User joined the game",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"2019-01-20 10:30:07 [CHAT] User: chat message",
|
||||
@@ -71,7 +71,7 @@ let testLines = new Map([
|
||||
type: "action",
|
||||
action: "CHAT",
|
||||
message: "User: chat message",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"2019-01-20 10:30:14 [COMMAND] User (command): blah",
|
||||
@@ -81,7 +81,7 @@ let testLines = new Map([
|
||||
type: "action",
|
||||
action: "COMMAND",
|
||||
message: "User (command): blah",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"2019-01-20 10:30:14 Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
||||
@@ -90,7 +90,7 @@ let testLines = new Map([
|
||||
time: "2019-01-20 10:30:14",
|
||||
type: "generic",
|
||||
message: "Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"2019-01-20 10:30:21 [LEAVE] User left the game",
|
||||
@@ -100,7 +100,7 @@ let testLines = new Map([
|
||||
type: "action",
|
||||
action: "LEAVE",
|
||||
message: "User left the game",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"Error while running event level::on_nth_tick(1)",
|
||||
@@ -108,7 +108,7 @@ let testLines = new Map([
|
||||
format: "none",
|
||||
type: "generic",
|
||||
message: "Error while running event level::on_nth_tick(1)",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"4802.763 Info AppManager.cpp:287: Saving to _autosave4 (blocking).",
|
||||
@@ -119,7 +119,7 @@ let testLines = new Map([
|
||||
level: "Info",
|
||||
file: "AppManager.cpp:287",
|
||||
message: "Saving to _autosave4 (blocking).",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
" 10.806 Info AppManager.cpp:394: Saving game as C:\\factorio\\saves\\world.zip",
|
||||
@@ -130,7 +130,7 @@ let testLines = new Map([
|
||||
level: "Info",
|
||||
file: "AppManager.cpp:394",
|
||||
message: "Saving game as C:\\factorio\\saves\\world.zip",
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
"4202.780 Info AppManagerStates.cpp:1802: Saving finished",
|
||||
@@ -141,7 +141,7 @@ let testLines = new Map([
|
||||
level: "Info",
|
||||
file: "AppManagerStates.cpp:1802",
|
||||
message: "Saving finished",
|
||||
}
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
|
||||
@@ -523,7 +523,7 @@ describe("lib/prometheus", function() {
|
||||
|
||||
let serializedResult = {
|
||||
metric: { type: "type", name: "name", help: "Help", labels: ["a", "b"] },
|
||||
samples: [ ['a="1",b="2"', 1], ['a="3",b="4"', 5], ]
|
||||
samples: [ ['a="1",b="2"', 1], ['a="3",b="4"', 5] ],
|
||||
};
|
||||
let deserializedResult = {
|
||||
metric: new prometheus.Metric("type", "name", "Help", ["a", "b"]),
|
||||
@@ -563,7 +563,7 @@ describe("lib/prometheus", function() {
|
||||
prometheus.serializeResult({
|
||||
metric: new prometheus.Metric("type", "name", "Help"),
|
||||
samples: new Map([["", 2]]),
|
||||
}, { metricName: "new", }),
|
||||
}, { metricName: "new" }),
|
||||
{
|
||||
metric: { type: "type", name: "new", help: "Help", labels: [] },
|
||||
samples: [["", 2]],
|
||||
@@ -573,7 +573,7 @@ describe("lib/prometheus", function() {
|
||||
prometheus.serializeResult({
|
||||
metric: new prometheus.Metric("type", "name", "Help"),
|
||||
samples: new Map([["", 2]]),
|
||||
}, { metricHelp: "old", }),
|
||||
}, { metricHelp: "old" }),
|
||||
{
|
||||
metric: { type: "type", name: "name", help: "old", labels: [] },
|
||||
samples: [["", 2]],
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ class MockInstance extends link.Link {
|
||||
get: (name) => {
|
||||
if (name === "instance.id") { return 7357; }
|
||||
throw Error("Not implemented");
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user