Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 4ba4f21b authored by Ray Schamp's avatar Ray Schamp
Browse files

Opt in to git hooks

parent 49d00636
Branches
Tags
No related merge requests found
......@@ -11,3 +11,4 @@ npm-*
# Build
/build
/.opt-in
......@@ -32,5 +32,31 @@ Then go to [http://localhost:8601/](http://localhost:8601/) - the playground out
npm test
```
## Git Hooks
If you would like to ensure your contributions build cleanly every time, opt in
to the git hooks for the project. Create a file called `.opt-in` in the root of
the project with the contents:
```
precommit
prepush
postmerge
postrewrite
```
Or you can include only the hooks you would like to use.
### precommit
Run lint before committing
### prepush
Run tests before pushing
### postmerge
`npm install` after merging
### postrewrite
`npm install` after rebasing
## Donate
We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!
......@@ -11,10 +11,10 @@
"clean": "rm -rf ./build && mkdir -p build",
"deploy": "gh-pages -x -r $GH_PAGES_URL -d build -m $DEPLOY_MESSAGE",
"lint": "eslint .",
"postmerge": "npm install",
"postrewrite": "npm install",
"precommit": "npm run lint",
"prepush": "npm run test",
"postmerge": "opt --in postmerge --exec 'npm install'",
"postrewrite": "opt --in postrewrite --exec 'npm install'",
"precommit": "opt --in precommit --exec 'npm run lint'",
"prepush": "opt --in prepush --exec 'npm run test'",
"start": "webpack-dev-server --port $npm_package_config_port --content-base=./build",
"test": "npm run lint && npm run build"
},
......@@ -41,6 +41,7 @@
"lodash.bindall": "4.4.0",
"lodash.defaultsdeep": "4.4.0",
"minilog": "3.0.1",
"opt-cli": "1.5.1",
"react": "15.x.x",
"react-dom": "15.x.x",
"scratch-blocks": "^0.1.0-prerelease",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment