Skip to content

Commit 9f5b714

Browse files
committed
Add spacing before blocks and keywords #168
* Add comments and fix spacing. Signed-off-by: Jillian Daguil <[email protected]>
1 parent 3d1f206 commit 9f5b714

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

.eslintrc.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@
5151
]
5252
}
5353
],
54-
"space-infix-ops": ["error", {"int32Hint": false}]
54+
"space-infix-ops": [
55+
"error",
56+
{
57+
"int32Hint": false
58+
}
59+
],
60+
"space-before-blocks": "error",
61+
"keyword-spacing": [
62+
"error",
63+
{
64+
"before": true
65+
}
66+
]
5567
}
5668
}

assets/app/js/aboutCodeDB.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717

18-
// Load Sequelize and create an in-memory database
1918
const Sequelize = require('sequelize');
2019
const fs = require('fs');
2120
const JSONStream = require('JSONStream');
@@ -26,6 +25,10 @@ const {parentPath} = require('./models/databaseUtils');
2625
* Manages the database created from a ScanCode JSON input.
2726
* The database contains tables for both flattened and unflattened data
2827
*
28+
* The config will load an existing database or will create a new, empty
29+
* database if none exists. For a new database, the data is loaded from a JSON
30+
* file by calling addFromJson(jsonFileName).
31+
*
2932
* @param config
3033
* @param config.dbName
3134
* @param config.dbUser

assets/app/js/aboutCodeDashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class AboutCodeDashboard extends View {
259259
static formatData(names) {
260260
// Sum the total number of times the name appears
261261
let count = {};
262-
$.each(names, function(i, name){
262+
$.each(names, function(i, name) {
263263
count[name] = count[name] + 1 || 1;
264264
});
265265

assets/app/js/helpers/barChart.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class BarChart {
164164

165165
let maxStr = '';
166166
$.each(names, function(i, name) {
167-
if(name.length > maxStr.length){
167+
if (name.length > maxStr.length) {
168168
maxStr = name;
169169
}
170170
});
@@ -182,7 +182,7 @@ class BarChart {
182182

183183
// Sum the total number of times the name appears
184184
let count = {};
185-
$.each(names, function(i, name){
185+
$.each(names, function(i, name) {
186186
count[name] = count[name] + 1 || 1;
187187
});
188188

@@ -196,7 +196,7 @@ class BarChart {
196196
});
197197

198198
// Sorts the data highest value to lowest value
199-
chartData.sort(function(a,b){
199+
chartData.sort(function(a,b) {
200200
if (a.val === b.val) {
201201
return a.name.localeCompare(b.name);
202202
} else {

assets/app/js/helpers/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Utils {
2323
for (let i = 0; i < values.length; i++) {
2424
attributeValue = values[i][attribute];
2525

26-
if (!Array.isArray(attributeValue) || attributeValue.length === 0){
26+
if (!Array.isArray(attributeValue) || attributeValue.length === 0) {
2727
attributeValue = [attributeValue];
2828
}
2929

test/eslint.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const esLintResults = engine.executeOnFiles(files).results;
3636
// for each failure
3737
describe('ESLint', () => esLintResults.forEach(({ filePath, messages }) => {
3838
it(`validates ${filePath}`, () => {
39-
if (messages) {
39+
if (messages.length > 0) {
4040
assert.fail(false, true, messages.map(formatError).join('\n'));
4141
}
4242
});

0 commit comments

Comments
 (0)