Skip to content

Commit

Permalink
fix: added lint, commit message and test commit/push hooks (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott committed Dec 12, 2019
1 parent 11cf7a6 commit 0292a63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 4 additions & 7 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const { config } = require('@dhis2/cli-style')

const tasks = arr => arr.join(' && ')
const husky = require(config.husky)

module.exports = {
hooks: {
...config.husky.hooks,
'pre-commit': tasks([
// 'd2-style js check --staged',
// 'd2-style text check --staged',
]),
...husky.hooks,
'pre-commit': 'yarn validate-commit',
'pre-push': 'yarn validate-push',
},
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules/*
/packages/app/node_modules/*
/packages/plugin/node_modules/*
/packages/app/build/*
/packages/plugin/build/*
/coverage/*
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"test-plugin": "cd packages/plugin && yarn test",
"test-app": "cd packages/app && yarn test",
"test": "yarn test-plugin && yarn test-app",
"coverage": "yarn test-plugin --coverage && yarn test-app --coverage"
"coverage": "yarn test-plugin --coverage && yarn test-app --coverage",
"validate-commit": "d2-style js check --staged && d2-style text check --staged",
"validate-push": "yarn test"
},
"workspaces": [
"packages/*"
Expand Down

0 comments on commit 0292a63

Please sign in to comment.