Permalink
Browse files

Add syntax.json file and fix code to conform

Thanks Syntux!
  • Loading branch information...
1 parent 1d963ad commit db04b7829f21abfaf8cf64fd0fd259c352b1fa90 @felixge committed Nov 17, 2011
Showing with 11 additions and 6 deletions.
  1. +3 −3 lib/Sample.js
  2. +5 −0 syntax.json
  3. +1 −1 test/common.js
  4. +1 −1 test/unit/metrics/test-Meter.js
  5. +1 −1 test/unit/util/test-BinaryHeap.js
View
@@ -5,9 +5,9 @@ function Sample() {
this.count = 0;
}
-Sample.prototype.init = function(){ this.clear(); }
+Sample.prototype.init = function(){ this.clear(); };
Sample.prototype.update = function(val){ this.values.push(val); };
Sample.prototype.clear = function(){ this.values = []; this.count = 0; };
Sample.prototype.size = function(){ return this.values.length;};
-Sample.prototype.print = function(){console.log(this.values);}
-Sample.prototype.getValues = function(){ return this.values; }
+Sample.prototype.print = function(){console.log(this.values);};
+Sample.prototype.getValues = function(){ return this.values; };
View
@@ -0,0 +1,5 @@
+{
+ "addSemicolons": true,
+ "trimWhitespace": true,
+ "quotes": "'"
+}
View
@@ -1,7 +1,7 @@
var common = exports;
var path = require('path');
-common.dir = {}
+common.dir = {};
common.dir.root = path.dirname(__dirname);
common.dir.lib = path.join(common.dir.root, 'lib');
@@ -27,7 +27,7 @@ test('Meter', {
var json = meter.toJSON();
assert.equal(json['count'], 5);
- assert.equal(json['1MinuteRate'].toFixed(4), '0.0800')
+ assert.equal(json['1MinuteRate'].toFixed(4), '0.0800');
assert.equal(json['5MinuteRate'].toFixed(4), '0.0165');
assert.equal(json['15MinuteRate'].toFixed(4), '0.0055');
@@ -132,7 +132,7 @@ test('BinaryHeap', {
return -obj;
}});
- heap.add(8, 7, 6, 5, 4, 3, 2, 1)
+ heap.add(8, 7, 6, 5, 4, 3, 2, 1);
assert.deepEqual(heap.toSortedArray(), [1, 2, 3, 4, 5, 6, 7, 8]);
},
});

3 comments on commit db04b78

What style-checker are you using with such syntax.json?

Owner

felixge replied May 25, 2012

https://github.com/evilhackerdude/syntux <- kind of stalled right now, but working well for most stuff.

Thanks! Looks like not more powerful that http://veged.github.com/krasota.js/.

Please sign in to comment.