Skip to content

Commit 03eb0a5

Browse files
committed
Let CI test confirm formatting
1 parent 3bd4b92 commit 03eb0a5

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"typings": "types/alasql.d.ts",
1515
"scripts": {
1616
"test": "sh build.sh && yarn test-only",
17-
"test-ci": "(yarn test-format || 1) && yarn test-only && yarn install-g && alasql 'select 1 as Succes'",
17+
"test-ci": "(yarn test-format-all || 1) && yarn test-only && yarn install-g && alasql 'select 1 as Succes'",
1818
"test-only": "node node_modules/mocha/bin/mocha.js ./test --reporter dot",
1919
"#test-only": "(command -v bun && bun node_modules/.bin/mocha ./test --reporter dot) || npx bun node_modules/.bin/mocha ./test --reporter dot",
2020
"test-browser": "node test/browserTestRunner.js 7387",
@@ -28,6 +28,7 @@
2828
"format": "yarn pretty-since-dev --write",
2929
"format-all": "yarn pretty-all --write",
3030
"test-format": "yarn pretty-since-dev --list-different || echo 'Please correct file formatting using `yarn format` and try again.'",
31+
"test-format-all": "yarn prettier --list-different '{.,src,test}/*.{js,ts,json}' || echo 'Please correct file formatting using `yarn format` and try again.'",
3132
"pretty-since-dev": "{ git diff --name-only --diff-filter=d origin/develop ; git diff --name-only --diff-filter=d --staged origin/develop ; } | sort | uniq | grep -vE '^dist/|^test/coverage|^lib/|.min.js$' | grep -E '\\.(scss|css|js|ts|vue|json)$' | xargs npx prettier",
3233
"pretty-commit": "{ git diff --name-only --diff-filter=d ; git diff --name-only --diff-filter=d --staged ; } | sort | uniq | grep -vE '^dist/|^test/coverage|^lib/|.min.js$' | grep -E '\\.(scss|css|js|ts|vue|json)$' | xargs npx prettier",
3334
"pretty-all": "git ls-tree --full-tree --name-only -r HEAD | grep -vE '^dist/|^test/coverage|^lib/|.min.js$' | grep -E '\\.(scss|css|js|ts|vue|json)$' | xargs npx prettier",

src/84from.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ alasql.from.JSON = function (filename, opts, cb, idx, query) {
124124
//console.log('cb',cb);
125125
//console.log('JSON');
126126
filename = alasql.utils.autoExtFilename(filename, 'json', opts);
127-
alasql.utils.loadFile(filename, !!cb, function (data) {
127+
(alasql.utils.loadFile(filename, !!cb, function (data) {
128128
// console.log('DATA:'+data);
129129
// res = [{a:1}];
130130
res = JSON.parse(data);
@@ -134,12 +134,12 @@ alasql.from.JSON = function (filename, opts, cb, idx, query) {
134134
}),
135135
err => {
136136
const error = err instanceof Error ? err : new Error(err);
137-
if(query && query.cb) {
137+
if (query && query.cb) {
138138
query.cb(null, error);
139139
return;
140140
}
141141
throw error;
142-
};
142+
});
143143
return res;
144144
};
145145

@@ -168,7 +168,7 @@ const jsonl = ext => {
168168
},
169169
err => {
170170
const error = err instanceof Error ? err : new Error(err);
171-
if(query && query.cb) {
171+
if (query && query.cb) {
172172
query.cb(null, error);
173173
return;
174174
}
@@ -244,7 +244,7 @@ alasql.from.CSV = function (contents, opts, cb, idx, query) {
244244
return EOF;
245245
}
246246
if (eol) {
247-
return (eol = false), EOL;
247+
return ((eol = false), EOL);
248248
}
249249
var j = I;
250250
if (text.charCodeAt(j) === quoteCode) {

test/test2112.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ describe('Test 2112 - load binary file', function () {
2020
});
2121

2222
it('C) Loads HTTPS binary file (async)', function (done) {
23-
alasql.utils.loadBinaryFile('https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg', true, function (data) {
24-
assert.equal(data.slice(0, 3), 'ÿØÿ');
25-
done();
26-
});
23+
alasql.utils.loadBinaryFile(
24+
'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg',
25+
true,
26+
function (data) {
27+
assert.equal(data.slice(0, 3), 'ÿØÿ');
28+
done();
29+
}
30+
);
2731
});
2832
});

test/test293.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (typeof exports === 'object') {
3232
return e(r ^ (t | ~o), n, t, u, c, f);
3333
}
3434
function i(n, r) {
35-
(n[r >> 5] |= 128 << r % 32), (n[(((r + 64) >>> 9) << 4) + 14] = r);
35+
((n[r >> 5] |= 128 << r % 32), (n[(((r + 64) >>> 9) << 4) + 14] = r));
3636
var e,
3737
i,
3838
a,
@@ -43,7 +43,7 @@ if (typeof exports === 'object') {
4343
v = -1732584194,
4444
m = 271733878;
4545
for (e = 0; e < n.length; e += 16)
46-
(i = l),
46+
((i = l),
4747
(a = g),
4848
(h = v),
4949
(d = m),
@@ -114,7 +114,7 @@ if (typeof exports === 'object') {
114114
(l = t(l, i)),
115115
(g = t(g, a)),
116116
(v = t(v, h)),
117-
(m = t(m, d));
117+
(m = t(m, d)));
118118
return [l, g, v, m];
119119
}
120120
function a(n) {
@@ -140,16 +140,16 @@ if (typeof exports === 'object') {
140140
u = [],
141141
c = [];
142142
for (u[15] = c[15] = void 0, o.length > 16 && (o = i(o, 8 * n.length)), r = 0; 16 > r; r += 1)
143-
(u[r] = 909522486 ^ o[r]), (c[r] = 1549556828 ^ o[r]);
144-
return (e = i(u.concat(h(t)), 512 + 8 * t.length)), a(i(c.concat(e), 640));
143+
((u[r] = 909522486 ^ o[r]), (c[r] = 1549556828 ^ o[r]));
144+
return ((e = i(u.concat(h(t)), 512 + 8 * t.length)), a(i(c.concat(e), 640)));
145145
}
146146
function g(n) {
147147
var t,
148148
r,
149149
e = '0123456789abcdef',
150150
o = '';
151151
for (r = 0; r < n.length; r += 1)
152-
(t = n.charCodeAt(r)), (o += e.charAt((t >>> 4) & 15) + e.charAt(15 & t));
152+
((t = n.charCodeAt(r)), (o += e.charAt((t >>> 4) & 15) + e.charAt(15 & t)));
153153
return o;
154154
}
155155
function v(n) {

test/test418.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (typeof exports === 'object') {
88
Test for issue #379
99
*/
1010

11-
let baseUrl = "github.com/AlaSQL/alasql/raw/refs/heads/develop"
11+
let baseUrl = 'github.com/AlaSQL/alasql/raw/refs/heads/develop';
1212

1313
var test = 418;
1414

0 commit comments

Comments
 (0)