Hygiene: don't auto-add on pre-commit

Since it can be unexpected for a pre-commit hook to make edits to the
commit, leverage the existing tests to simply verify that the proper
files have been staged. This also slightly simplifies the existing NPM
scripts and forces the dev to run the same test about to be executed CI,
`npm test` itself, which previously had no other automation tie in.

Change-Id: I74e407ea17a6c2809a49ba56d3ef28b25d5ba5de
This commit is contained in:
Stephen Niedzielski 2018-05-01 13:40:05 -05:00
parent c2a37d75e2
commit 36741c96c8

View file

@ -5,12 +5,11 @@
"build": "NODE_ENV=production webpack -p",
"lint:fix": "grunt fix",
"test:node": "node tests/node-qunit/run.js 'tests/node-qunit/**/*.test.js' | tap-dot",
"test:dev": "grunt lint && npm -s run coverage && npm -s run -s doc",
"test": "npm -s run check-built-assets && npm -s run test:dev",
"test": "npm -s run check-built-assets && grunt lint && npm -s run coverage && npm -s run -s doc && bundlesize",
"doc": "jsdoc -c jsdoc.json",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff -q resources/dist",
"coverage": "SPAWN_WRAP_SHIM_ROOT=\"$PWD/.nyc_output\" nyc npm -s run test:node",
"precommit": "npm -s run test:dev && npm -s run build && git add resources/dist && bundlesize"
"precommit": "npm -s t"
},
"devDependencies": {
"babel-loader": "7.1.4",