Skip to content

Commit 401936a

Browse files
committed
Add disallowTrailingSpaces rule
1 parent a2ef74e commit 401936a

8 files changed

Lines changed: 21 additions & 20 deletions

File tree

.jscsrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"disallowMultipleLineBreaks": true,
2424
"disallowKeywordsOnNewLine": ["else"],
2525
"requireLineFeedAtFileEnd": true,
26+
"disallowTrailingWhitespace": true,
2627
"excludeFiles": ["node_modules/**", "bower_components/**"],
2728
"validateIndentation": 2
2829
}

src/compression/runlength/runlength.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Run-length encoding.
3-
* The idea of this algorithm is to remove the usless zeros and
3+
* The idea of this algorithm is to remove the usless zeros and
44
* give us representation of string in binary which in which the
55
* zeros will be stripped and replaced with their count.
66
*/

src/data-structures/binary-search-tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
/**
191191
* Finds a node by it's value in a given sub-tree.
192192
* Average time complexity: O(log N).
193-
*
193+
*
194194
* @private
195195
* @param {Number|String} Value of the node which should be found.
196196
* @param {Node} Current node to be checked.
@@ -221,7 +221,7 @@
221221
* @param {Node} oldChild Child to be replaced.
222222
* @param {Node} newChild Child replacement.
223223
*/
224-
exports.BinaryTree.prototype._replaceChild =
224+
exports.BinaryTree.prototype._replaceChild =
225225
function (parent, oldChild, newChild) {
226226
if (!parent) {
227227
this._root = newChild;

src/data-structures/heap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
/**
9898
* Changes the key.<br><br>
9999
* Complexity: O(log N).
100-
*
100+
*
101101
* @public
102102
* @param {Number} index Index of the value which should be changed.
103103
* @param {Number|Object} value New value according to the index.

src/data-structures/interval-tree.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
/**
2626
* Node which describes an interval.
27-
*
27+
*
2828
* @public
2929
* @constructor
3030
* @param {Number} start Start of the interval.
@@ -39,7 +39,7 @@
3939
*/
4040
this.interval = [start, end];
4141
/**
42-
* Max endpoint in subtree which starts from this node.
42+
* Max endpoint in subtree which starts from this node.
4343
* @member {Number}
4444
*/
4545
this.max = -Infinity;
@@ -106,7 +106,7 @@
106106

107107
/**
108108
* Add new interval to the tree.
109-
*
109+
*
110110
* @public
111111
* @param {Array} intreval Array with start and end points of the interval.
112112
*/
@@ -141,7 +141,7 @@
141141
/**
142142
* Checks or point belongs to at least one intarval from the tree.<br><br>
143143
* Complexity: O(log N).
144-
*
144+
*
145145
* @public
146146
* @method
147147
* @param {Number} point Point which should be checked.
@@ -196,7 +196,7 @@
196196

197197
/**
198198
* Returns height of the tree.
199-
*
199+
*
200200
* @public
201201
* @method
202202
* @return {Number} Height of the tree.

src/data-structures/red-black-tree.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Red-Black tree is a data structure which is
33
* a type of self-balancing binary search tree.
4-
*
4+
*
55
* @example
66
*
77
* var RBTree = require('../src/data-structures/red-black-tree').RBTree;
@@ -25,7 +25,7 @@
2525
* });
2626
*
2727
* console.log(rbTree.get(1989)); // { name: 'Garry', surname: 'Fisher' }
28-
*
28+
*
2929
* @module data-structures/red-black-tree
3030
*/
3131
(function (exports) {
@@ -43,7 +43,7 @@
4343

4444
/**
4545
* Node of the Red-Black tree.
46-
*
46+
*
4747
* @private
4848
* @constructor
4949
* @param {Number} key Key of the node.
@@ -105,7 +105,7 @@
105105

106106
/**
107107
* Red-Black Tree.
108-
*
108+
*
109109
* @public
110110
* @constructor
111111
*/
@@ -116,7 +116,7 @@
116116
/**
117117
* Add value associated with a given key.<br><br>
118118
* Complexity: O(log N).
119-
*
119+
*
120120
* @public
121121
* @method
122122
* @param {Number} key Key.
@@ -130,7 +130,7 @@
130130
/**
131131
* Returns true or false depending on whether
132132
* given node is red.
133-
*
133+
*
134134
* @private
135135
* @method
136136
* @param {Node} node Node which sould be checked.
@@ -146,7 +146,7 @@
146146
/**
147147
* Helper function for insertion of given key,
148148
* value pair into the Red-Black tree.
149-
*
149+
*
150150
* @private
151151
* @method
152152
* @param {Number} key Key.

src/graphs/shortest-path/dijkstra.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@
6363
}
6464

6565
/**
66-
* Dijkstra's shortest path algorithm. Finds the minimum
66+
* Dijkstra's shortest path algorithm. Finds the minimum
6767
* distance between two given nodes using a distance matrix.<br><br>
6868
* For the implementation is not used the most suitable data structure
6969
* (Fibonacci heap) but the Binary heap gives also good results.<br><br>
7070
*
7171
* Time complexity: O(|E|+|V|log(|V|)) where V and E are the number of
7272
* vertices and edges respectively.
73-
*
73+
*
7474
* @public
7575
* @module graphs/shortest-path/dijkstra
7676
* @param {Number} src Source node.
7777
* @param {Number} dest Destination node.
7878
* @param {Array} graph A distance matrix of the graph.
7979
* @returns {Number} The shortest distance between two nodes.
80-
*
80+
*
8181
* @example
8282
* var dijkstra =
8383
* require('path-to-algorithms/src/graphs/shortest-path/dijkstra').dijkstra;

test/graphs/searching/bfs.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('BFS', function () {
4141
*
4242
* 0 ---> 1
4343
* \ |
44-
* \ v
44+
* \ v
4545
* -> 2
4646
*/
4747
it('should not update the parent node once set', function () {

0 commit comments

Comments
 (0)