Skip to content

Commit

Permalink
Merge 4.0 (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 6, 2020
1 parent 436ca18 commit 0ffe785
Show file tree
Hide file tree
Showing 37 changed files with 763 additions and 905 deletions.
28 changes: 13 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
module.exports = {
"parser": "@typescript-eslint/parser",
"extends": [
"xo-space/esnext",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
parser: '@typescript-eslint/parser',
extends: [
'xo-space/esnext',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint'
],
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"prettier/prettier": "error"
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'capitalized-comments': 'off',
'prettier/prettier': 'error'
},
"env": {
"jest": true,
"node": true,
env: {
jest: true,
node: true
}
}
6 changes: 2 additions & 4 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"skipCI": false,
"hooks": {
"pre-commit": "npm test",
"post-checkout": "rm -f ci-post-checkout && echo \"running CI post-checkout test\" && node scripts/ci-post-checkout-script"
"commit-msg": "echo \"commit-msg hook from Husky\" && echo $HUSKY_GIT_PARAMS > hook-params"
}
}
}
5 changes: 2 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.gitattributes
.github
.eslintrc
.huskyrc
.prettierrc
.travis.yml
appveyor.yml
ci-post-checkout
preprocessor.js
scripts
src
tsconfig.json
typings
docs-util.js
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"semi": false,
"singleQuote": true
}
}
22 changes: 2 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,12 @@ os:
language: node_js
node_js:
- "node"
- "8"
- "10"
cache:
directories:
- "node_modules"
env:
- HUSKY_DEBUG=1
script:
- sh ./scripts/test-install.sh
- npm test

# Install hooks locally
- npm run devinstall
- cat .git/hooks/post-checkout

# Test HUSKY_SKIP_HOOKS
- HUSKY_SKIP_HOOKS=1 time git checkout
- node scripts/ci-husky-skip-hooks-check

# Test post-checkout hook
- time git checkout
- node scripts/ci-post-checkout-check

# Should not fail due to missing script
- node scripts/ci-break-path.js
- time git checkout

# Test uninstall
- npm run devuninstall
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Husky can prevent bad `git commit`, `git push` and more 🐶 _woof!_
## Install

```sh
npm install husky --save-dev
npm install husky@next --save-dev
```

```js
Expand Down
21 changes: 1 addition & 20 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,8 @@ test_script:
- npm --version

# Run tests
- sh ./scripts/test-install.sh
- npm test

# Install hooks locally
- npm run devinstall
- cat .git/hooks/post-checkout

# Test HUSKY_SKIP_HOOKS
- ps: $env:HUSKY_SKIP_HOOKS=1
- node scripts/ci-husky-skip-hooks-check
- ps: $env:HUSKY_SKIP_HOOKS=0

# Test post-checkout hook
- git checkout
- node scripts/ci-post-checkout-check

# Should not fail due to missing script
- node scripts/ci-break-path.js
- git checkout

# Test uninstall
- npm run devuninstall

# Don't actually build.
build: off
14 changes: 11 additions & 3 deletions husky.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
/* eslint-disable */
// @ts-ignore
const pleaseUpgradeNode = require('please-upgrade-node')
const pkg = require('./package.json')

// Node version isn't supported, skip install
pleaseUpgradeNode(pkg, {
exitCode: 0,
message: function(requiredVersion) {
return 'Husky requires Node ' + requiredVersion + ', skipping Git hooks installation.'
return (
'Husky requires Node ' +
requiredVersion +
', skipping Git hooks installation.'
)
}
})

// Node version is supported, continue
require('./lib/installer/bin')

try {
require('./lib/installer/bin')
} catch (e) {
console.log('missing lib directory')
}
Loading

0 comments on commit 0ffe785

Please sign in to comment.