Skip to content

Commit 53c4144

Browse files
author
Travis Jeffery
committed
Merge pull request #1376 from slang800/master
add an .editorconfig
2 parents 97de6a1 + c6747a6 commit 53c4144

Some content is hidden

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

84 files changed

+64
-119
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 2
13+
14+
[Makefile]
15+
indent_style = tab

index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
module.exports = process.env.COV
32
? require('./lib-cov/mocha')
4-
: require('./lib/mocha');
3+
: require('./lib/mocha');

lib/browser/debug.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
module.exports = function(type){
32
return function(){
43
}

lib/browser/escape-string-regexp.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
44

55
module.exports = function (str) {
6-
if (typeof str !== 'string') {
7-
throw new TypeError('Expected a string');
8-
}
6+
if (typeof str !== 'string') {
7+
throw new TypeError('Expected a string');
8+
}
99

10-
return str.replace(matchOperatorsRe, '\\$&');
10+
return str.replace(matchOperatorsRe, '\\$&');
1111
};

lib/browser/events.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module exports.
43
*/
@@ -175,4 +174,4 @@ EventEmitter.prototype.emit = function (name) {
175174
}
176175

177176
return true;
178-
};
177+
};

lib/browser/progress.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,28 @@ Progress.prototype.draw = function(ctx){
9494
, y = half
9595
, rad = half - 1
9696
, fontSize = this._fontSize;
97-
97+
9898
ctx.font = fontSize + 'px ' + this._font;
99-
99+
100100
var angle = Math.PI * 2 * (percent / 100);
101101
ctx.clearRect(0, 0, size, size);
102-
102+
103103
// outer circle
104104
ctx.strokeStyle = '#9f9f9f';
105105
ctx.beginPath();
106106
ctx.arc(x, y, rad, 0, angle, false);
107107
ctx.stroke();
108-
108+
109109
// inner circle
110110
ctx.strokeStyle = '#eee';
111111
ctx.beginPath();
112112
ctx.arc(x, y, rad - 1, 0, angle, true);
113113
ctx.stroke();
114-
114+
115115
// text
116116
var text = this._text || (percent | 0) + '%'
117117
, w = ctx.measureText(text).width;
118-
118+
119119
ctx.fillText(
120120
text
121121
, x - w / 2 + 1

lib/browser/tty.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
exports.isatty = function(){
32
return true;
43
};

lib/context.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Expose `Context`.
43
*/

lib/hook.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/interfaces/bdd.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/interfaces/exports.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/interfaces/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
exports.bdd = require('./bdd');
32
exports.tdd = require('./tdd');
43
exports.qunit = require('./qunit');

lib/interfaces/qunit.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/interfaces/tdd.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/base.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/doc.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/dot.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/html-cov.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/
@@ -48,4 +47,4 @@ function coverageClass(n) {
4847
if (n >= 50) return 'medium';
4948
if (n >= 25) return 'low';
5049
return 'terrible';
51-
}
50+
}

lib/reporters/html.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
exports.Base = require('./base');
32
exports.Dot = require('./dot');
43
exports.Doc = require('./doc');

lib/reporters/json-cov.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/json-stream.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/
@@ -58,4 +57,4 @@ function clean(test) {
5857
, fullTitle: test.fullTitle()
5958
, duration: test.duration
6059
}
61-
}
60+
}

lib/reporters/json.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/landing.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/
@@ -94,4 +93,4 @@ function Landing(runner) {
9493
* Inherit from `Base.prototype`.
9594
*/
9695

97-
Landing.prototype.__proto__ = Base.prototype;
96+
Landing.prototype.__proto__ = Base.prototype;

lib/reporters/list.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/markdown.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ function Markdown(runner) {
8888
process.stdout.write(generateTOC(runner.suite));
8989
process.stdout.write(buf);
9090
});
91-
}
91+
}

lib/reporters/min.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/tap.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/reporters/templates/style.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,4 @@
317317
code .string { color: #5890AD }
318318
code .keyword { color: #8A6343 }
319319
code .number { color: #2F6FAD }
320-
</style>
320+
</style>

lib/reporters/xunit.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/runnable.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/suite.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

lib/test.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

media/logo.svg

+1-2

mocha.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -734,28 +734,28 @@ Progress.prototype.draw = function(ctx){
734734
, y = half
735735
, rad = half - 1
736736
, fontSize = this._fontSize;
737-
737+
738738
ctx.font = fontSize + 'px ' + this._font;
739-
739+
740740
var angle = Math.PI * 2 * (percent / 100);
741741
ctx.clearRect(0, 0, size, size);
742-
742+
743743
// outer circle
744744
ctx.strokeStyle = '#9f9f9f';
745745
ctx.beginPath();
746746
ctx.arc(x, y, rad, 0, angle, false);
747747
ctx.stroke();
748-
748+
749749
// inner circle
750750
ctx.strokeStyle = '#eee';
751751
ctx.beginPath();
752752
ctx.arc(x, y, rad - 1, 0, angle, true);
753753
ctx.stroke();
754-
754+
755755
// text
756756
var text = this._text || (percent | 0) + '%'
757757
, w = ctx.measureText(text).width;
758-
758+
759759
ctx.fillText(
760760
text
761761
, x - w / 2 + 1
@@ -6092,4 +6092,4 @@ mocha.run = function(fn){
60926092
*/
60936093

60946094
Mocha.process = process;
6095-
})();
6095+
})();

support/compile.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Module dependencies.
43
*/

support/foot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
})();
1+
})();

test/acceptance/context.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
describe('Context', function(){
32
beforeEach(function(){
43
this.calls = ['before'];

test/acceptance/diffs.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var fs = require('fs')
32
, cssin = fs.readFileSync('test/acceptance/fixtures/css.in', 'ascii')
43
, cssout = fs.readFileSync('test/acceptance/fixtures/css.out', 'ascii');

test/acceptance/duration.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
describe('durations', function(){
32
describe('when slow', function(){
43
it('should highlight in red', function(done){

test/acceptance/fixtures/css.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ body {
66

77
a {
88
color: blue
9-
}
9+
}

test/acceptance/fixtures/css.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ a {
1010

1111
foo {
1212
bar: 'baz';
13-
}
13+
}

test/acceptance/fs.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var fs = require('fs');
32

43
describe('fs.readFile()', function(){

test/acceptance/glob/glob.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
describe('globbing test', function(){
32
it('should find this test', function(){
43
// see glob.sh for details

test/acceptance/globals.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
describe('global leaks', function(){
32
before(function(){
43
// uncomment to test

test/acceptance/http.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var http = require('http');
32

43
var server = http.createServer(function(req, res){
@@ -14,4 +13,4 @@ describe('http', function(){
1413
done();
1514
})
1615
})
17-
})
16+
})

test/acceptance/interfaces/bdd.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
describe('Array', function(){
32
describe('#indexOf()', function(){
43
it('should return -1 when the value is not present', function(){

test/acceptance/interfaces/exports.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var calls = [];
32

43
exports.Array = {

test/acceptance/interfaces/qunit.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
function ok(expr, msg) {
32
if (!expr) throw new Error(msg);
43
}
@@ -21,4 +20,4 @@ suite('String');
2120

2221
test('#length', function(){
2322
ok('foo'.length == 3);
24-
});
23+
});

test/acceptance/interfaces/tdd.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
suite('Array', function(){
32
suite('#indexOf()', function(){
43
var initialValue = 32;

0 commit comments

Comments
 (0)