Skip to content

Commit 144e0b8

Browse files
committed
npm run lint
1 parent 7d61699 commit 144e0b8

File tree

203 files changed

+14314
-15594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+14314
-15594
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
Contribution Guidelines
2-
-----------------------
1+
## Contribution Guidelines
32

4-
### A Note on Issues and Support ##
3+
### A Note on Issues and Support
54

65
We try to be available pretty often to help when problems come up. We like to split incoming questions
76
into two categories: potential bugs/features, and questions. If you want a feature added, or think you've found a bug
87
in the code (or in the examples), search the [issue tracker](https://github.com/nodegit/nodegit/issues) and if you don't
98
find anything, file a new issue. If you just have questions, instead of using issues, [sign up](http://slack.libgit2.org/)
109
to libgit2's Slack instance and then contact us in the [#nodegit channel](https://libgit2.slack.com/messages/nodegit/).
1110

12-
## How to Help ##
11+
## How to Help
1312

1413
NodeGit is iterating pretty quickly, but it can always go faster. We welcome help with the deeper darker parts,
1514
like the templates and binding and more, but there are plenty of smaller things to do as well.
1615
Things that are always needed:
17-
- Filing issues (see above).
18-
- Writing tests (See [here](https://github.com/nodegit/nodegit/blob/master/TESTING.md)).
19-
- Writing examples.
16+
17+
- Filing issues (see above).
18+
- Writing tests (See [here](https://github.com/nodegit/nodegit/blob/master/TESTING.md)).
19+
- Writing examples.
2020

2121
These are all good easy ways to start getting involved with the project. You can also look through the issue tracker
2222
and see if you can help with any existing issues. Please comment with your intention and any questions before getting

FAQ.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
NodeGit FAQ
2-
-----------
1+
## NodeGit FAQ
32

43
Feel free to add common problems with their solutions here, or just anything that wasn't clear at first.
54

6-
#### Error: callback returned unsupported credentials type ####
5+
#### Error: callback returned unsupported credentials type
76

87
As seen in nodegit/#959 -- some golang hackers have started to use the following stanza in .gitconfig to allow `go get` to work with private repos:
8+
99
```
1010
[url "git@github.com:"]
1111
insteadOf = https://github.com/
1212
```
13+
1314
But if you do this, code can call `NodeGit.Clone.clone(url: 'https://foo')` and have the `authentication` callback be asked for **SSH** credentials instead of HTTPS ones, which might not be what your application expected.

HISTORY.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
0.2.0 / 2014-11-24
2-
===================
1+
# 0.2.0 / 2014-11-24
32

4-
* Shifted to promises; asynchronous methods now provide promises.
5-
* Lots of new methods exposed for merging, pushing, blaming and more.
6-
* SSH transport now works.
7-
* Switched generation of native module code from ejsg to Combyne.
8-
* Added continuous integration with Linux, OSX, and Windows.
9-
* Many method and property names have changed.
3+
- Shifted to promises; asynchronous methods now provide promises.
4+
- Lots of new methods exposed for merging, pushing, blaming and more.
5+
- SSH transport now works.
6+
- Switched generation of native module code from ejsg to Combyne.
7+
- Added continuous integration with Linux, OSX, and Windows.
8+
- Many method and property names have changed.

README.md

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,34 @@
66

77
**Stable (libgit2@v0.28.3): 0.28.3**
88

9-
## Have a problem? Come chat with us! ##
9+
## Have a problem? Come chat with us!
1010

1111
Visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up, then join us in #nodegit.
1212

13-
## Maintained by ##
13+
## Maintained by
14+
1415
Tyler Ang-Wanek [@twwanek](http://twitter.com/twwanek) with help from tons of
1516
[awesome contributors](https://github.com/nodegit/nodegit/contributors)!
1617

17-
### Alumni Maintainers ###
18+
### Alumni Maintainers
19+
1820
Tim Branyen [@tbranyen](http://twitter.com/tbranyen),
1921
John Haley [@johnhaley81](http://twitter.com/johnhaley81),
2022
Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp),
2123
Steve Smith [@orderedlist](https://twitter.com/orderedlist),
2224
Michael Robinson [@codeofinterest](http://twitter.com/codeofinterest), and
2325
Nick Kallen [@nk](http://twitter.com/nk)
2426

25-
## API Documentation. ##
27+
## API Documentation.
2628

2729
[http://www.nodegit.org/](http://www.nodegit.org/)
2830

29-
## Getting started. ##
31+
## Getting started.
3032

3133
NodeGit will work on most systems out-of-the-box without any native
3234
dependencies.
3335

34-
``` bash
36+
```bash
3537
npm install nodegit
3638
```
3739

@@ -41,15 +43,15 @@ libstdc++-4.9.
4143

4244
In Ubuntu:
4345

44-
``` sh
46+
```sh
4547
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
4648
sudo apt-get update
4749
sudo apt-get install libstdc++-4.9-dev
4850
```
4951

5052
In Travis:
5153

52-
``` yaml
54+
```yaml
5355
addons:
5456
apt:
5557
sources:
@@ -60,117 +62,120 @@ addons:
6062
6163
In CircleCI:
6264
63-
``` yaml
64-
dependencies:
65-
pre:
66-
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
67-
- sudo apt-get update
68-
- sudo apt-get install -y libstdc++-4.9-dev
65+
```yaml
66+
dependencies:
67+
pre:
68+
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
69+
- sudo apt-get update
70+
- sudo apt-get install -y libstdc++-4.9-dev
6971
```
7072
71-
If you receive errors about *lifecycleScripts* preinstall/install you probably miss *libssl-dev*
73+
If you receive errors about _lifecycleScripts_ preinstall/install you probably miss _libssl-dev_
7274
In Ubuntu:
75+
7376
```
7477
sudo apt-get install libssl-dev
7578
```
7679

7780
You will need the following libraries installed on your linux machine:
78-
- libpcre
79-
- libpcreposix
80-
- libkrb5
81-
- libk5crypto
82-
- libcom_err
81+
82+
- libpcre
83+
- libpcreposix
84+
- libkrb5
85+
- libk5crypto
86+
- libcom_err
8387

8488
When building locally, you will also need development packages for kerberos and pcre, so both of these utilities must be present on your machine:
85-
- pcre-config
86-
- krb5-config
8789

90+
- pcre-config
91+
- krb5-config
8892

8993
If you are still encountering problems while installing, you should try the
9094
[Building from source](http://www.nodegit.org/guides/install/from-source/)
9195
instructions.
9296

93-
## API examples. ##
97+
## API examples.
9498

95-
### Cloning a repository and reading a file: ###
99+
### Cloning a repository and reading a file:
96100

97-
``` javascript
98-
var Git = require("nodegit");
101+
```javascript
102+
var Git = require('nodegit');
99103

100104
// Clone a given repository into the `./tmp` folder.
101-
Git.Clone("https://github.com/nodegit/nodegit", "./tmp")
105+
Git.Clone('https://github.com/nodegit/nodegit', './tmp')
102106
// Look up this known commit.
103-
.then(function(repo) {
107+
.then(function (repo) {
104108
// Use a known commit sha from this repository.
105-
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5");
109+
return repo.getCommit('59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5');
106110
})
107111
// Look up a specific file within that commit.
108-
.then(function(commit) {
109-
return commit.getEntry("README.md");
112+
.then(function (commit) {
113+
return commit.getEntry('README.md');
110114
})
111115
// Get the blob contents from the file.
112-
.then(function(entry) {
116+
.then(function (entry) {
113117
// Patch the blob to contain a reference to the entry.
114-
return entry.getBlob().then(function(blob) {
118+
return entry.getBlob().then(function (blob) {
115119
blob.entry = entry;
116120
return blob;
117121
});
118122
})
119123
// Display information about the blob.
120-
.then(function(blob) {
124+
.then(function (blob) {
121125
// Show the path, sha, and filesize in bytes.
122-
console.log(blob.entry.path() + blob.entry.sha() + blob.rawsize() + "b");
126+
console.log(blob.entry.path() + blob.entry.sha() + blob.rawsize() + 'b');
123127

124128
// Show a spacer.
125-
console.log(Array(72).join("=") + "\n\n");
129+
console.log(Array(72).join('=') + '\n\n');
126130

127131
// Show the entire file.
128132
console.log(String(blob));
129133
})
130-
.catch(function(err) { console.log(err); });
131-
134+
.catch(function (err) {
135+
console.log(err);
136+
});
132137
```
133138

134-
### Emulating git log: ###
139+
### Emulating git log:
135140

136-
``` javascript
137-
var Git = require("nodegit");
141+
```javascript
142+
var Git = require('nodegit');
138143

139144
// Open the repository directory.
140-
Git.Repository.open("tmp")
145+
Git.Repository.open('tmp')
141146
// Open the master branch.
142-
.then(function(repo) {
147+
.then(function (repo) {
143148
return repo.getMasterCommit();
144149
})
145150
// Display information about commits on master.
146-
.then(function(firstCommitOnMaster) {
151+
.then(function (firstCommitOnMaster) {
147152
// Create a new history event emitter.
148153
var history = firstCommitOnMaster.history();
149154

150155
// Create a counter to only show up to 9 entries.
151156
var count = 0;
152157

153158
// Listen for commit events from the history.
154-
history.on("commit", function(commit) {
159+
history.on('commit', function (commit) {
155160
// Disregard commits past 9.
156161
if (++count >= 9) {
157162
return;
158163
}
159164

160165
// Show the commit sha.
161-
console.log("commit " + commit.sha());
166+
console.log('commit ' + commit.sha());
162167

163168
// Store the author object.
164169
var author = commit.author();
165170

166171
// Display author information.
167-
console.log("Author:\t" + author.name() + " <" + author.email() + ">");
172+
console.log('Author:\t' + author.name() + ' <' + author.email() + '>');
168173

169174
// Show the commit date.
170-
console.log("Date:\t" + commit.date());
175+
console.log('Date:\t' + commit.date());
171176

172177
// Give some space and show the message.
173-
console.log("\n " + commit.message());
178+
console.log('\n ' + commit.message());
174179
});
175180

176181
// Start emitting events.
@@ -180,10 +185,10 @@ Git.Repository.open("tmp")
180185

181186
For more examples, check the `examples/` folder.
182187

183-
## Unit tests. ##
188+
## Unit tests.
184189

185-
You will need to build locally before running the tests. See above.
190+
You will need to build locally before running the tests. See above.
186191

187-
``` bash
192+
```bash
188193
npm test
189194
```

TESTING.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
Test Contribution Guidelines
2-
----------------------------
1+
## Test Contribution Guidelines
32

43
This is a guide on how to contribute test cases to help with coverage testing for NodeGit.
54

6-
## Getting Started ##
5+
## Getting Started
76

87
Currently there are a number of fields and functions in NodeGit that have no tests at all. A list of which files are missing and what fields and functions need tests can be generated by running
98

10-
``` bash
9+
```bash
1110
npm run generateMissingTests
1211
```
1312

14-
>You should have run already `npm install .` or it will complain about
13+
> You should have run already `npm install .` or it will complain about
1514
> missing `nodegit-promise` or suchlike
1615
1716
This will make the file `generate/output/missing-tests.json` which will contain info for tests or files that are currently missing.
1817

1918
From this file you can find fields and functions that don't have any tests yet and pick one to work on.
2019

21-
## Adding a test ##
20+
## Adding a test
2221

2322
After you find a test that's missing the next step is to find or add the file that you need to add it into. You can always use other tests in the directory as a guide for writing more. All new files will be automatically added during a test run.
2423

2524
In the `missing-tests.json` file you'll see it formatted like so:
2625

2726
```json
2827
{
29-
"{className}":{
28+
"{className}": {
3029
"fields": [],
3130
"functions": []
3231
}
@@ -48,19 +47,19 @@ You can mark something to be ignored inside of the `/generate/missing-tests-igno
4847

4948
After you write your test make sure to run `npm run generateMissingTests` again to confirm that the field/function that a test was written for no longer shows up.
5049

51-
## Test results ##
50+
## Test results
5251

53-
### The test passes ###
52+
### The test passes
5453

5554
Excellent!! Make sure that the test is working correctly and testing what you're expecting it to test and then move onto the [next section](#making-a-pull-request).
5655

57-
### The test fails ###
56+
### The test fails
5857

5958
This is also great! You just found something that wasn't properly covered in our generate scripts for wrapping libgit2. We'll have to further analyze what's going on and figure out how to fix it.
6059

6160
For bonus points you could also include a fix in your pull request but that step is optional.
6261

63-
## Making a pull request ##
62+
## Making a pull request
6463

6564
So you made your self a new test for NodeGit and now you want to add it to the main repo? That's great! We'll try and make the process as simple and easy as possible for you.
6665

examples/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
## /examples
22

3-
List of examples of using NodeGit to implement common git core operations.
4-
3+
List of examples of using NodeGit to implement common git core operations.

0 commit comments

Comments
 (0)