Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an .editorconfig #1376

Merged
merged 2 commits into from
Oct 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module.exports = function(type){
return function(){
}
Expand Down
8 changes: 4 additions & 4 deletions lib/browser/escape-string-regexp.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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

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

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

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/interfaces/index.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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

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

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

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/html-cov.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/index.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/json-stream.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/landing.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/markdown.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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

/**
* Module dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/templates/style.html
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

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

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

/**
* Module dependencies.
*/
Expand Down
3 changes: 1 addition & 2 deletions media/logo.svg
Loading
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
Original file line number Diff line number Diff line change
Expand Up @@ -719,28 +719,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 @@ -6071,4 +6071,4 @@ mocha.run = function(fn){
*/

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

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

describe('Context', function(){
beforeEach(function(){
this.calls = ['before'];
Expand Down
1 change: 0 additions & 1 deletion test/acceptance/diffs.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ body {

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

foo {
bar: 'baz';
}
}
1 change: 0 additions & 1 deletion test/acceptance/fs.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

var calls = [];

exports.Array = {
Expand Down
3 changes: 1 addition & 2 deletions test/acceptance/interfaces/qunit.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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