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

Commit 6ffbfd5

Browse files
committed
Update docs for leetcode 2.2.0
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent 016b0ab commit 6ffbfd5

File tree

9 files changed

+46
-33
lines changed

9 files changed

+46
-33
lines changed

docs/cpp.lint.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Run cpplint to check c++ code syntax before running `test` against leetcode.com.
44

55
## Requirement
66

7-
* `cpplint.py`: [download](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)
7+
* need install`cpplint.py`: [download](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)
88

99
## Config
1010

@@ -13,12 +13,21 @@ Run cpplint to check c++ code syntax before running `test` against leetcode.com.
1313
* `+` to enable specific checking.
1414
* `-` to disable specific checking.
1515

16+
*Set Config*
17+
18+
$ leetcode config plugins:cpp.lint:bin <path of cpplint>
19+
$ leetcode config plugins:cpp.lint:flags '["-whitespace/indent"]'
20+
21+
*Unset Config*
22+
23+
$ leetcode config -d plugins:cpp.lint
24+
1625
*Example*
1726

1827
{
19-
"PLUGINS": {
28+
"plugins": {
2029
"cpp.lint": {
21-
"bin": "<path of cpplint script>",
30+
"bin": "/usr/bin/cpplint.py",
2231
"flags": [
2332
"-whitespace/indent"
2433
]

docs/cpp.run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NOTE: not fully support all the questions!
1010

1111
## Requirement
1212

13-
* `g++` with c++11 support.
13+
* need install `g++` with c++11 support.
1414

1515
## Usage
1616

docs/github.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,28 @@
22

33
Auto commit the accepted code to your own (public) GitHub repo.
44

5+
## Requirement
6+
7+
* create an access token for your github repo.
8+
59
## Config
610

711
* `repo`: your GitHub repo to persistent accpeted code.
812
* `token`: the access token to your repo, see [how to get token](#generate-token).
913

14+
*Set Config*
15+
16+
$ leetcode config plugins:github:repo <link of your repo>
17+
$ leetcode config plugins:github:token <your token>
18+
19+
*Unset Config*
20+
21+
$ leetcode config -f plugins:github
22+
1023
*Example*
1124

1225
{
13-
"PLUGINS": {
26+
"plugins": {
1427
"github": {
1528
"repo": "https://github.com/skygragon/test",
1629
"token": "xxxxxxxxxxxxx"

plugins/company.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
var Plugin = require('../plugin');
22

3-
// [prerequisite]
43
//
5-
// [config]
4+
// [Usage]
5+
//
6+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/company.md
67
//
78
var plugin = new Plugin(100, 'company', '2017.12.18',
89
'Plugin to query by company for free user.');

plugins/cpp.lint.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,11 @@ var cp = require('child_process');
33
var log = require('../log');
44
var Plugin = require('../plugin');
55

6-
// [prerequisite]
76
//
8-
// Need install cpplint:
9-
// https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
7+
// [Usage]
108
//
11-
// [config]
9+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/cpp.lint.md
1210
//
13-
// You can disable/enable some checks in "flags" section.
14-
//
15-
// "PLUGINS": {
16-
// "cpp.lint": {
17-
// "bin": "<path of cpplint script>",
18-
// "flags": [
19-
// "-whitespace/indent",
20-
// <other flags>
21-
// ]
22-
// }
23-
// }
2411
var plugin = new Plugin(100, 'cpp.lint', '2017.07.27',
2512
'Plugin to do static code check on c++ code.');
2613

plugins/cpp.run.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ var session = require('../session');
1111
//
1212
// Only works for those problems could be easily tested.
1313
//
14-
// [prerequisite]
14+
// [Usage]
15+
//
16+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/cpp.run.md
1517
//
16-
// - g++ (support c++11)
1718
var plugin = new Plugin(100, 'cpp.run', '2017.07.29',
1819
'Plugin to run cpp code locally for debugging.');
1920

plugins/github.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,11 @@ var h = require('../helper');
55
var log = require('../log');
66
var Plugin = require('../plugin');
77

8-
// [prerequisite]
98
//
10-
// - create a new access token on your github repo setting. (TBD)
9+
// [Usage]
1110
//
12-
// [config]
11+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/github.md
1312
//
14-
// "PLUGINS": {
15-
// "github": {
16-
// "repo": "https://github.com/<your_name>/<your_repo>/<folder_you_like>",
17-
// "token": "<token created above>"
18-
// }
19-
// }
2013
var plugin = new Plugin(100, 'github', '2017.08.10',
2114
'Plugin to commit accepted code to your own github repo.',
2215
['github']);

plugins/lintcode.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ var session = require('../session');
1414
// TODO: star/submissions/submission
1515
// FIXME: why [ERROR] Error: read ECONNRESET [0]??
1616
//
17+
// [Usage]
18+
//
19+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/lintcode.md
20+
//
1721
var plugin = new Plugin(15, 'lintcode', '2017.08.04',
1822
'Plugin to talk with lintcode APIs.');
1923

plugins/solution.discuss.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ var chalk = require('../chalk');
66
var Plugin = require('../plugin');
77
var session = require('../session');
88

9+
//
10+
// [Usage]
11+
//
12+
// https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/solution.discuss.md
13+
//
914
var plugin = new Plugin(200, 'solution.discuss', '2017.07.29',
1015
'Plugin to fetch most voted solution in discussions.');
1116

0 commit comments

Comments
 (0)