Skip to content

Commit

Permalink
Adds pre-commit hooks using Husky (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwessman authored Jul 2, 2023
1 parent f89f7a0 commit bec4339
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ Dir
puts failures
```

## Development

Setup linting:

```sh
npm run prepare
```

Install dependencies and run tests:

```sh
bundle
bundle exec rake
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/davidwessman/syntax_tree-erb.
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scripts": {
"prepare": "husky install"
},
"lint-staged": {
"lib/**/*.rb": [
"bundle exec stree write"
]
}
}

0 comments on commit bec4339

Please sign in to comment.