-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscripts.yml
44 lines (39 loc) · 2.13 KB
/
scripts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Prerequisites:
# https://deno.land/manual/getting_started/installation
# deno install -qAn vr https://deno.land/x/velociraptor/cli.ts
# Running examples (cd to any dir in this repo):
# vr test
#
# Helpful info:
# https://velociraptor.run/docs/vscode/
# https://blog.logrocket.com/exploring-velociraptor-deno-npm-style-script-runner/
scripts:
lint:
- deno lint -c deno.json
- vr eslint-setup
- vr eslint
eslint-setup:
- deno cache --node-modules-dir --unstable npm:[email protected] && echo>/dev/null
- deno cache --node-modules-dir --unstable npm:eslint-plugin-compat && echo>/dev/null
- deno cache --node-modules-dir --unstable npm:eslint-plugin-import && echo>/dev/null
- deno cache --node-modules-dir --unstable npm:eslint-plugin-no-floating-promise && echo>/dev/null
eslint:
# We want to call either `eslint .` or `eslint [arg1] <arg2> ..`
- echo . >| .testarg && echo >> .testarg
# Next, two unusual things going on in..
# Unfortunately right now running deno like this always exits 0, regardless.
# Lint warnings/errors write to stdout -- so capture that to a file and check after if empty.
# Wrap that with `script` command so the invoker will still see the useful colors in the output.
- script -q .testout sh -c "deno run -A --node-modules-dir --unstable npm:eslint@^7.32.0
$(egrep . .testarg |tail -1) 2>/dev/null" && echo>/dev/null
- rm .testarg; echo>/dev/null
# .testout should be empty -- else a lint failure (remove any docker runtime start/stop logs)
- egrep -v '^Script (started|done) on ' .testout |egrep . |sort -o .testout && echo>/dev/null
- test ! -s .testout && echo>/dev/null
- rm -f .testout && echo>/dev/null
test:
- rm -rf coverage && echo>/dev/null
- deno test -A --coverage=coverage --ignore=node_modules --no-check
--location=https://internetarchive.github.io/ia/
- deno coverage coverage --exclude=no-exclusions --lcov >| coverage/lcov.lcov && echo>/dev/null
- lcov --derive-func-data -l coverage/lcov.lcov && echo>/dev/null