Skip to content
Snippets Groups Projects
Commit fab837b9 authored by Éloïs's avatar Éloïs
Browse files

[ci] add format check on tests job

parent a925f2c4
No related branches found
No related tags found
1 merge request!1315auto install rust
...@@ -86,6 +86,7 @@ tests: ...@@ -86,6 +86,7 @@ tests:
stage: tests stage: tests
script: script:
- npm i - npm i
- npm run format:check
- npm test - npm test
# Push coverage to GitLab pages # Push coverage to GitLab pages
- tar cvzf coverage.tar.gz coverage/ - tar cvzf coverage.tar.gz coverage/
......
...@@ -265,7 +265,13 @@ export class MultimeterWatcher implements Watcher { ...@@ -265,7 +265,13 @@ export class MultimeterWatcher implements Watcher {
if (duration) { if (duration) {
const durationSecs = Math.floor(duration / 1000); const durationSecs = Math.floor(duration / 1000);
const durationMillisRemain = 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 { } else {
this.multi.write("\nAll done.\n"); 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 @@ ...@@ -36,8 +36,8 @@
"install": "./neon/build.sh", "install": "./neon/build.sh",
"lint": "lint-staged", "lint": "lint-staged",
"prettier": "prettier --write app/**/*/*.ts", "prettier": "prettier --write app/**/*/*.ts",
"format:check": "prettier --list-different \"app/**/*.{ts,json}\"", "format:check": "./format.sh check",
"format:all": "prettier --write \"app/**/*.{ts,json}\"" "format:all": "./format.sh all"
}, },
"nyc": { "nyc": {
"require": [ "require": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment