Add shellcheck lint (#7392)

* Add shellcheck lint script

* Add to build

* Add shellcheck lint to main lint task

* Put shellcheck in the right place, hopefully?

* Fix declared multiple executor types

* Add sudo

* Address shellcheck warnings

* Add test-lint-shellcheck

* Add test-lint-shellcheck to workflow

* Use correct lint task

* output version which could be helpful for debugging

* Address PR feedback

* consistency++
feature/default_network_editable
ricky 5 years ago committed by GitHub
parent a26e77c61e
commit 476274474f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      .circleci/config.yml
  2. 2
      development/auto-changelog.sh
  3. 14
      development/rollback.sh
  4. 1
      package.json

@ -22,6 +22,7 @@ workflows:
- test-lint: - test-lint:
requires: requires:
- prep-deps - prep-deps
- test-lint-shellcheck
- test-e2e-chrome: - test-e2e-chrome:
requires: requires:
- prep-deps - prep-deps
@ -49,6 +50,7 @@ workflows:
- all-tests-pass: - all-tests-pass:
requires: requires:
- test-lint - test-lint
- test-lint-shellcheck
- test-unit - test-unit
- test-unit-global - test-unit-global
- test-mozilla-lint - test-mozilla-lint
@ -173,6 +175,16 @@ jobs:
name: Verify locales name: Verify locales
command: yarn verify-locales --quiet command: yarn verify-locales --quiet
test-lint-shellcheck:
docker:
- image: circleci/node:10.17-browsers
steps:
- checkout
- run: sudo apt-get install shellcheck
- run:
name: Shellcheck Lint
command: yarn lint:shellcheck
test-deps: test-deps:
docker: docker:
- image: circleci/node:10.17-browsers - image: circleci/node:10.17-browsers

@ -10,7 +10,7 @@ git fetch --tags
most_recent_tag="$(git describe --tags "$(git rev-list --tags --max-count=1)")" most_recent_tag="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
git rev-list "${most_recent_tag}"..HEAD | while read commit git rev-list "${most_recent_tag}"..HEAD | while read -r commit
do do
subject="$(git show -s --format="%s" "$commit")" subject="$(git show -s --format="%s" "$commit")"

@ -4,20 +4,20 @@
echo "Rolling back to version $1" echo "Rolling back to version $1"
# Checkout branch to increment version # Checkout branch to increment version
git checkout -b version-increment-$1 git checkout -b "version-increment-$1"
yarn version:bump patch yarn version:bump patch
# Store the new version name # Store the new version name
NEW_VERSION=$(cat app/manifest.json | jq -r .version) NEW_VERSION=$(jq -r .version < app/manifest.json)
# Make sure origin tags are loaded # Make sure origin tags are loaded
git fetch origin git fetch origin
# check out the rollback branch # check out the rollback branch
git checkout origin/v$1 git checkout "origin/v$1"
# Create the rollback branch. # Create the rollback branch.
git checkout -b Version-$NEW_VERSION-Rollback-to-$1 git checkout -b "Version-$NEW_VERSION-Rollback-to-$1"
# Set the version files to the next one. # Set the version files to the next one.
git checkout master CHANGELOG.md git checkout master CHANGELOG.md
@ -28,8 +28,8 @@ git commit -m "Version $NEW_VERSION (Rollback to $1)"
git push -u origin HEAD git push -u origin HEAD
# Create tag and push that up too # Create tag and push that up too
git tag v${NEW_VERSION} git tag "v${NEW_VERSION}"
git push origin v${NEW_VERSION} git push origin "v${NEW_VERSION}"
# Cleanup version branch # Cleanup version branch
git branch -D version-increment-$1 git branch -D "version-increment-$1"

@ -37,6 +37,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",
"verify-locales": "node ./development/verify-locale-strings.js", "verify-locales": "node ./development/verify-locale-strings.js",
"mozilla-lint": "addons-linter dist/firefox", "mozilla-lint": "addons-linter dist/firefox",
"watch": "cross-env METAMASK_ENV=test mocha --watch --require test/setup.js --reporter min --recursive \"test/unit/**/*.js\" \"ui/app/**/*.test.js\"", "watch": "cross-env METAMASK_ENV=test mocha --watch --require test/setup.js --reporter min --recursive \"test/unit/**/*.js\" \"ui/app/**/*.test.js\"",

Loading…
Cancel
Save