Skip to content

Commit

Permalink
Merge pull request #1376 from slang800/master
Browse files Browse the repository at this point in the history
add an .editorconfig
  • Loading branch information
Travis Jeffery committed Oct 13, 2014
2 parents 97de6a1 + c6747a6 commit 53c4144
Show file tree
Hide file tree
Showing 84 changed files with 64 additions and 119 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
3 changes: 1 addition & 2 deletions index.js
@@ -1,4 +1,3 @@

module.exports = process.env.COV
? require('./lib-cov/mocha')
: require('./lib/mocha');
: require('./lib/mocha');
1 change: 0 additions & 1 deletion lib/browser/debug.js
@@ -1,4 +1,3 @@

module.exports = function(type){
return function(){
}
Expand Down
8 changes: 4 additions & 4 deletions lib/browser/escape-string-regexp.js
Expand Up @@ -3,9 +3,9 @@
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;

module.exports = function (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}

return str.replace(matchOperatorsRe, '\\$&');
return str.replace(matchOperatorsRe, '\\$&');
};
3 changes: 1 addition & 2 deletions lib/browser/events.js
@@ -1,4 +1,3 @@

/**
* Module exports.
*/
Expand Down Expand Up @@ -175,4 +174,4 @@ EventEmitter.prototype.emit = function (name) {
}

return true;
};
};
12 changes: 6 additions & 6 deletions lib/browser/progress.js
Expand Up @@ -94,28 +94,28 @@ Progress.prototype.draw = function(ctx){
, y = half
, rad = half - 1
, fontSize = this._fontSize;

ctx.font = fontSize + 'px ' + this._font;

var angle = Math.PI * 2 * (percent / 100);
ctx.clearRect(0, 0, size, size);

// outer circle
ctx.strokeStyle = '#9f9f9f';
ctx.beginPath();
ctx.arc(x, y, rad, 0, angle, false);
ctx.stroke();

// inner circle
ctx.strokeStyle = '#eee';
ctx.beginPath();
ctx.arc(x, y, rad - 1, 0, angle, true);
ctx.stroke();

// text
var text = this._text || (percent | 0) + '%'
, w = ctx.measureText(text).width;

ctx.fillText(
text
, x - w / 2 + 1
Expand Down
1 change: 0 additions & 1 deletion lib/browser/tty.js
@@ -1,4 +1,3 @@

exports.isatty = function(){
return true;
};
Expand Down
1 change: 0 additions & 1 deletion lib/context.js
@@ -1,4 +1,3 @@

/**
* Expose `Context`.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/hook.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/bdd.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/exports.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/index.js
@@ -1,4 +1,3 @@

exports.bdd = require('./bdd');
exports.tdd = require('./tdd');
exports.qunit = require('./qunit');
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/qunit.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/tdd.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/base.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/doc.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/dot.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/html-cov.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -48,4 +47,4 @@ function coverageClass(n) {
if (n >= 50) return 'medium';
if (n >= 25) return 'low';
return 'terrible';
}
}
1 change: 0 additions & 1 deletion lib/reporters/html.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/index.js
@@ -1,4 +1,3 @@

exports.Base = require('./base');
exports.Dot = require('./dot');
exports.Doc = require('./doc');
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/json-cov.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/json-stream.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -58,4 +57,4 @@ function clean(test) {
, fullTitle: test.fullTitle()
, duration: test.duration
}
}
}
1 change: 0 additions & 1 deletion lib/reporters/json.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/landing.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -94,4 +93,4 @@ function Landing(runner) {
* Inherit from `Base.prototype`.
*/

Landing.prototype.__proto__ = Base.prototype;
Landing.prototype.__proto__ = Base.prototype;
1 change: 0 additions & 1 deletion lib/reporters/list.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/markdown.js
Expand Up @@ -88,4 +88,4 @@ function Markdown(runner) {
process.stdout.write(generateTOC(runner.suite));
process.stdout.write(buf);
});
}
}
1 change: 0 additions & 1 deletion lib/reporters/min.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/spec.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/tap.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/templates/style.html
Expand Up @@ -317,4 +317,4 @@
code .string { color: #5890AD }
code .keyword { color: #8A6343 }
code .number { color: #2F6FAD }
</style>
</style>
1 change: 0 additions & 1 deletion lib/reporters/xunit.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/runnable.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/suite.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/test.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions media/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions mocha.js
Expand Up @@ -734,28 +734,28 @@ Progress.prototype.draw = function(ctx){
, y = half
, rad = half - 1
, fontSize = this._fontSize;

ctx.font = fontSize + 'px ' + this._font;

var angle = Math.PI * 2 * (percent / 100);
ctx.clearRect(0, 0, size, size);

// outer circle
ctx.strokeStyle = '#9f9f9f';
ctx.beginPath();
ctx.arc(x, y, rad, 0, angle, false);
ctx.stroke();

// inner circle
ctx.strokeStyle = '#eee';
ctx.beginPath();
ctx.arc(x, y, rad - 1, 0, angle, true);
ctx.stroke();

// text
var text = this._text || (percent | 0) + '%'
, w = ctx.measureText(text).width;

ctx.fillText(
text
, x - w / 2 + 1
Expand Down Expand Up @@ -6092,4 +6092,4 @@ mocha.run = function(fn){
*/

Mocha.process = process;
})();
})();
1 change: 0 additions & 1 deletion support/compile.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion support/foot.js
@@ -1 +1 @@
})();
})();
1 change: 0 additions & 1 deletion test/acceptance/context.js
@@ -1,4 +1,3 @@

describe('Context', function(){
beforeEach(function(){
this.calls = ['before'];
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/diffs.js
@@ -1,4 +1,3 @@

var fs = require('fs')
, cssin = fs.readFileSync('test/acceptance/fixtures/css.in', 'ascii')
, cssout = fs.readFileSync('test/acceptance/fixtures/css.out', 'ascii');
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/duration.js
@@ -1,4 +1,3 @@

describe('durations', function(){
describe('when slow', function(){
it('should highlight in red', function(done){
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/fixtures/css.in
Expand Up @@ -6,4 +6,4 @@ body {

a {
color: blue
}
}
2 changes: 1 addition & 1 deletion test/acceptance/fixtures/css.out
Expand Up @@ -10,4 +10,4 @@ a {

foo {
bar: 'baz';
}
}
1 change: 0 additions & 1 deletion test/acceptance/fs.js
@@ -1,4 +1,3 @@

var fs = require('fs');

describe('fs.readFile()', function(){
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/glob/glob.js
@@ -1,4 +1,3 @@

describe('globbing test', function(){
it('should find this test', function(){
// see glob.sh for details
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/globals.js
@@ -1,4 +1,3 @@

describe('global leaks', function(){
before(function(){
// uncomment to test
Expand Down
3 changes: 1 addition & 2 deletions test/acceptance/http.js
@@ -1,4 +1,3 @@

var http = require('http');

var server = http.createServer(function(req, res){
Expand All @@ -14,4 +13,4 @@ describe('http', function(){
done();
})
})
})
})
1 change: 0 additions & 1 deletion test/acceptance/interfaces/bdd.js
@@ -1,4 +1,3 @@

describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present', function(){
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/interfaces/exports.js
@@ -1,4 +1,3 @@

var calls = [];

exports.Array = {
Expand Down
3 changes: 1 addition & 2 deletions test/acceptance/interfaces/qunit.js
@@ -1,4 +1,3 @@

function ok(expr, msg) {
if (!expr) throw new Error(msg);
}
Expand All @@ -21,4 +20,4 @@ suite('String');

test('#length', function(){
ok('foo'.length == 3);
});
});
1 change: 0 additions & 1 deletion test/acceptance/interfaces/tdd.js
@@ -1,4 +1,3 @@

suite('Array', function(){
suite('#indexOf()', function(){
var initialValue = 32;
Expand Down

0 comments on commit 53c4144

Please sign in to comment.