Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 87357ec

Browse files
author
ouyangjunyi
committed
bug-fix: submission api changed
1 parent c5f6b89 commit 87357ec

File tree

7 files changed

+1105
-794
lines changed

7 files changed

+1105
-794
lines changed

.eslintrc.js

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
11
module.exports = {
2-
"env": {
3-
"browser": false,
4-
"es6": true,
5-
"mocha": true,
6-
"node": true
7-
},
8-
"extends": [
9-
"google",
10-
"eslint:recommended"
11-
],
12-
"rules": {
13-
"block-spacing": [2, "always"],
14-
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
15-
"camelcase": [2, {properties: "never"}],
16-
"comma-dangle": 0,
17-
"curly": 0,
18-
"key-spacing": [2, {align: "value"}],
19-
"max-len": [1, 120],
20-
"no-control-regex": 0,
21-
"no-console": 1,
22-
"no-empty": [2, { "allowEmptyCatch": true }],
23-
"no-eval": 1, // we use it on purpose
24-
"no-loop-func": 1,
25-
"no-multi-spaces": 0,
26-
"no-proto": 1,
27-
"no-unused-expressions": 1,
28-
"no-unused-vars": 1,
29-
"no-var": 0,
30-
"no-warning-comments": 0,
31-
"prefer-rest-params": 0,
32-
"prefer-spread": 0,
33-
"quote-props": 1,
34-
"quotes": [2, "single", {avoidEscape: true}],
35-
"require-jsdoc": 0,
36-
}
2+
env: {
3+
browser: false,
4+
es6: true,
5+
mocha: true,
6+
node: true,
7+
},
8+
parserOptions: {
9+
ecmaVersion: 8,
10+
},
11+
extends: [],
12+
rules: {},
3713
};

.vscode/launch.json

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "node",
9-
"request": "launch",
10-
"name": "Launch Program",
11-
"program": "${workspaceFolder}/bin/leetcode",
12-
"args": ["show", "1", "--solution"]
13-
},
14-
{
15-
"type": "node",
16-
"request": "launch",
17-
"name": "Mocha Tests",
18-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
19-
"args": [
20-
"-u",
21-
"tdd",
22-
"--timeout",
23-
"999999",
24-
"--colors",
25-
"${workspaceFolder}/test/plugins"
26-
],
27-
"internalConsoleOptions": "openOnSessionStart"
28-
},
29-
]
30-
}
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceFolder}/bin/leetcode",
12+
"args": ["show", "1", "--solution"]
13+
},
14+
{
15+
"type": "node",
16+
"request": "launch",
17+
"name": "mine",
18+
"program": "${workspaceFolder}/bin/leetcode",
19+
"args": ["submission", "-l", "C++", "94"]
20+
},
21+
{
22+
"type": "node",
23+
"request": "launch",
24+
"name": "Mocha Tests",
25+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
26+
"args": [
27+
"-u",
28+
"tdd",
29+
"--timeout",
30+
"999999",
31+
"--colors",
32+
"${workspaceFolder}/test/plugins"
33+
],
34+
"internalConsoleOptions": "openOnSessionStart"
35+
}
36+
]
37+
}

lib/commands/submission.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function exportSubmission(problem, argv, cb) {
114114
if (e) return cb(e);
115115

116116
const opts = {
117-
lang: submission.lang,
117+
lang: submission.lang=='C++'?'cpp':submission.lang,
118118
code: submission.code,
119119
tpl: argv.extra ? 'detailed' : 'codeonly'
120120
};

0 commit comments

Comments
 (0)