Add lint and test workflows
Tests / Test (Go) (push) Successful in 1m46s
Tests / Test (Python) (push) Successful in 14s
Lint / Lint (Go) (push) Successful in 21s
Lint / Lint (Python) (push) Successful in 10s
Tests / Test (Node/Svelte) (push) Successful in 12s
Lint / Lint (Node/Svelte) (push) Successful in 40s
Tests / Test (Go) (push) Successful in 1m46s
Tests / Test (Python) (push) Successful in 14s
Lint / Lint (Go) (push) Successful in 21s
Lint / Lint (Python) (push) Successful in 10s
Tests / Test (Node/Svelte) (push) Successful in 12s
Lint / Lint (Node/Svelte) (push) Successful in 40s
This commit is contained in:
1 parent
838a97d344
commit
fbbdab49bc
8 files changed
+242
-2
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { readdirSync, statSync } from 'node:fs';
|
||||
import { join, relative } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = fileURLToPath(new URL('..', import.meta.url));
|
||||
const directories = ['packages/node-backend/src', 'packages/node-backend/test'];
|
||||
|
||||
function javascriptFiles(directory) {
|
||||
const absoluteDirectory = join(root, directory);
|
||||
const files = [];
|
||||
for (const entry of readdirSync(absoluteDirectory)) {
|
||||
const absolutePath = join(absoluteDirectory, entry);
|
||||
if (statSync(absolutePath).isFile() && /\.(?:c|m)?js$/.test(entry)) {
|
||||
files.push(absolutePath);
|
||||
}
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
for (const directory of directories) {
|
||||
for (const file of javascriptFiles(directory)) {
|
||||
execFileSync(process.execPath, ['--check', file], { stdio: 'inherit' });
|
||||
console.log(`Syntax OK: ${relative(root, file)}`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user