mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Add lint:shellcheck:package (#7568)
* Add lint:shellcheck:package * Add double quote as per jq suggestion * Use single quotes * Ignore SC2016 * Use shellcheck script * Set some flags * Put shellcheck --version on new line * Disable SC2016 (singe quotes is actually what we want here)
This commit is contained in:
parent
12fb5ad985
commit
e5682eec38
14
development/shellcheck.sh
Executable file
14
development/shellcheck.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
set -x
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
shellcheck --version
|
||||||
|
# lint all *.sh files
|
||||||
|
find . -type f -name '*.sh' ! -path './node_modules/*' -print0 | xargs -0 shellcheck
|
||||||
|
# lint all .scripts in package.json
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
list=$(jq -r '.scripts | keys[] as $key | .[$key]' < package.json)
|
||||||
|
printf "#!/bin/bash\n%s\n" "$list" | shellcheck -
|
@ -26,7 +26,7 @@
|
|||||||
"test:web3:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-web3.sh",
|
"test:web3:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-web3.sh",
|
||||||
"test:e2e:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-all.sh",
|
"test:e2e:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-all.sh",
|
||||||
"test:coverage": "nyc --reporter=text --reporter=html npm run test:unit",
|
"test:coverage": "nyc --reporter=text --reporter=html npm run test:unit",
|
||||||
"test:coveralls-upload": "if [ $COVERALLS_REPO_TOKEN ]; then nyc report --reporter=text-lcov | coveralls; fi",
|
"test:coveralls-upload": "if [ \"$COVERALLS_REPO_TOKEN\" ]; then nyc report --reporter=text-lcov | coveralls; fi",
|
||||||
"test:flat": "yarn test:flat:build && karma start test/flat.conf.js",
|
"test:flat": "yarn test:flat:build && karma start test/flat.conf.js",
|
||||||
"test:flat:build": "yarn test:flat:build:ui && yarn test:flat:build:tests && yarn test:flat:build:locales",
|
"test:flat:build": "yarn test:flat:build:ui && yarn test:flat:build:tests && yarn test:flat:build:locales",
|
||||||
"test:flat:build:tests": "node test/integration/index.js",
|
"test:flat:build:tests": "node test/integration/index.js",
|
||||||
@ -39,7 +39,7 @@
|
|||||||
"lint:fix": "eslint . --ext js,json --fix",
|
"lint:fix": "eslint . --ext js,json --fix",
|
||||||
"lint:changed": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' --regexp='[.]json$' | tr '\\n' '\\0' | xargs -0 eslint",
|
"lint:changed": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' --regexp='[.]json$' | tr '\\n' '\\0' | xargs -0 eslint",
|
||||||
"lint:changed:fix": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' --regexp='[.]json$' | tr '\\n' '\\0' | xargs -0 eslint --fix",
|
"lint:changed:fix": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' --regexp='[.]json$' | tr '\\n' '\\0' | xargs -0 eslint --fix",
|
||||||
"lint:shellcheck": "shellcheck --version && find . -type f -name '*.sh' ! -path './node_modules/*' -print0 | xargs -0 shellcheck",
|
"lint:shellcheck": "./development/shellcheck.sh",
|
||||||
"verify-locales": "node ./development/verify-locale-strings.js",
|
"verify-locales": "node ./development/verify-locale-strings.js",
|
||||||
"verify-locales:fix": "node ./development/verify-locale-strings.js --fix",
|
"verify-locales:fix": "node ./development/verify-locale-strings.js --fix",
|
||||||
"mozilla-lint": "addons-linter dist/firefox",
|
"mozilla-lint": "addons-linter dist/firefox",
|
||||||
|
Loading…
Reference in New Issue
Block a user