From 63014d4c51fa05fbe4df15f997b9c6de3387b244 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Thu, 12 Apr 2018 14:15:45 +0200 Subject: [PATCH 1/3] chore: add commit message validation --- .nvmrc | 1 + README.md | 6 ++ package-lock.json | 164 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 ++- 4 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..24458a5e31 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v9.4.0 diff --git a/README.md b/README.md index ad80eb0283..68c0cfe3a8 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,12 @@ discussion, pull requests, feature requests and any type of feedback. We request adhere to the [Contributor Covenant](CODE_OF_CONDUCT.md) and work with us to make the collaboration and community productive and fun for everyone :) +### Commit messages + +We follow and automatically validate +[Angular-like formatting](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) for our +commit messages, for consistency and clarity. + ### Setting up your development environment ./bin/bootstrap-osx diff --git a/package-lock.json b/package-lock.json index 36bcedaa51..a7f7e1dbc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1349,6 +1349,30 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cosmiconfig": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-4.0.0.tgz", + "integrity": "sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ==", + "dev": true, + "requires": { + "is-directory": "0.3.1", + "js-yaml": "3.10.0", + "parse-json": "4.0.0", + "require-from-string": "2.0.2" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + } + } + }, "crc": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.5.0.tgz", @@ -2454,6 +2478,87 @@ "extend": "3.0.1" } }, + "husky": { + "version": "0.15.0-rc.13", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.15.0-rc.13.tgz", + "integrity": "sha512-J9bDyA3vllcIDPmYquNMuklEWKoHEhjqA3YG23Pic130ZueTks23JcjlVwMxWnf4dOjqEadwYFxG3svLFXZhYA==", + "dev": true, + "requires": { + "cosmiconfig": "4.0.0", + "execa": "0.9.0", + "is-ci": "1.1.0", + "pkg-dir": "2.0.0", + "pupa": "1.0.0", + "read-pkg": "3.0.0", + "run-node": "0.2.0", + "slash": "1.0.0" + }, + "dependencies": { + "execa": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.9.0.tgz", + "integrity": "sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA==", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -2609,11 +2714,26 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=" }, + "is-ci": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", + "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "dev": true, + "requires": { + "ci-info": "1.1.2" + } + }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, "is-docker": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-1.1.0.tgz", @@ -2624,6 +2744,12 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, + "is-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-file/-/is-file-1.0.0.tgz", + "integrity": "sha1-KKRM+9nT2xkwRfIrZfzo7fliBZY=", + "dev": true + }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", @@ -4167,6 +4293,15 @@ "pinkie": "2.0.4" } }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + }, "prettier": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.10.2.tgz", @@ -4238,6 +4373,12 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, + "pupa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-1.0.0.tgz", + "integrity": "sha1-mpVopa9+ZXuEYqbp1TKHQ1YM7/Y=", + "dev": true + }, "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", @@ -4514,6 +4655,12 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", @@ -4571,6 +4718,12 @@ "is-promise": "2.1.0" } }, + "run-node": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/run-node/-/run-node-0.2.0.tgz", + "integrity": "sha512-Zsnxrr+CMGfm7VFuCj96E8tOpFHTEuZS9EvlXcKapVr2RUvr+fxTMxNgK5fXi3TprSgWoxobtR/3TXZT4na/Ng==", + "dev": true + }, "runtypes": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/runtypes/-/runtypes-0.13.1.tgz", @@ -6021,6 +6174,17 @@ "homedir-polyfill": "1.0.1" } }, + "validate-commit": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/validate-commit/-/validate-commit-3.4.0.tgz", + "integrity": "sha512-v63luZ4YLoH68xAvd/cgalyMT+au+I75itAnP9te7eR/PiaqptH366iz3Gmc7NWBC9/fFfoVsI7m8MYqDvoJBw==", + "dev": true, + "requires": { + "chalk": "2.3.1", + "is-file": "1.0.0", + "yargs": "10.1.2" + } + }, "validate-npm-package-license": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", diff --git a/package.json b/package.json index 7ebeb36773..fa66305a48 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@types/prettyjson": "0.0.28", "@types/yargs": "^11.0.0", "chai": "^4.1.2", + "husky": "^0.15.0-rc.13", "json-schema-to-typescript": "^5.2.2", "license-checker": "^18.0.0", "mocha": "^4.1.0", @@ -85,7 +86,8 @@ "tslint": "^5.8.0", "tslint-microsoft-contrib": "^5.0.1", "typescript": "^2.7.2", - "typescript-formatter": "^7.0.1" + "typescript-formatter": "^7.0.1", + "validate-commit": "^3.4.0" }, "scripts": { "add-licenses": "./bin/add-licenses", @@ -109,5 +111,10 @@ "update-submodules": "git submodule update --init --recursive --jobs 4", "watch": "npm run build -- -w" }, + "husky": { + "hooks": { + "commit-msg": "validate-commit-msg -p angular" + } + }, "snyk": true } From 17f9cd2bb6c00fc8c8871b294affc446ef781c5c Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Thu, 12 Apr 2018 14:17:44 +0200 Subject: [PATCH 2/3] chore: add pre-push hook to run tests before pushing This should make sure we don't waste time because we forget to test or lint before we push our PRs. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fa66305a48..079919b094 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,8 @@ }, "husky": { "hooks": { - "commit-msg": "validate-commit-msg -p angular" + "commit-msg": "validate-commit-msg -p angular", + "pre-push": "npm test" } }, "snyk": true From f6e11d914491f3b74b40782b84776e3f36c6180d Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Thu, 12 Apr 2018 14:19:12 +0200 Subject: [PATCH 3/3] fix: add missing license header --- src/commands/environment/destroy.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/environment/destroy.ts b/src/commands/environment/destroy.ts index ad30dd18b9..882618ea0d 100644 --- a/src/commands/environment/destroy.ts +++ b/src/commands/environment/destroy.ts @@ -1,3 +1,11 @@ +/* + * Copyright (C) 2018 Garden Technologies, Inc. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + import { every, reduce } from "lodash" import { Command, EnvironmentOption, ParameterValues } from "../base"