Commit fab837b9 authored by Éloïs's avatar Éloïs

[ci] add format check on tests job

parent a925f2c4
......@@ -86,6 +86,7 @@ tests:
stage: tests
script:
- npm i
- npm run format:check
- npm test
# Push coverage to GitLab pages
- tar cvzf coverage.tar.gz coverage/
......
......@@ -265,7 +265,13 @@ export class MultimeterWatcher implements Watcher {
if (duration) {
const durationSecs = Math.floor(duration / 1000);
const durationMillisRemain = duration % 1000;
this.multi.write("\nAll done in " + durationSecs + "." + durationMillisRemain + " seconds.\n");
this.multi.write(
"\nAll done in " +
durationSecs +
"." +
durationMillisRemain +
" seconds.\n"
);
} else {
this.multi.write("\nAll done.\n");
}
......
#!/bin/sh
if [ "${1}" = "check" ]
then
$HOME/.cargo/bin/cargo fmt -- --check && prettier --list-different "app/**/*.{ts,json}"
elif [ "${1}" = "all" ]
then
$HOME/.cargo/bin/cargo fmt && prettier --write "app/**/*.{ts,json}"
else
echo "first argument must be \"check\" or \"all\"."
fi
......@@ -36,8 +36,8 @@
"install": "./neon/build.sh",
"lint": "lint-staged",
"prettier": "prettier --write app/**/*/*.ts",
"format:check": "prettier --list-different \"app/**/*.{ts,json}\"",
"format:all": "prettier --write \"app/**/*.{ts,json}\""
"format:check": "./format.sh check",
"format:all": "./format.sh all"
},
"nyc": {
"require": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment