Skip to content

Commit

Permalink
Add support for running as git pre-commit hook (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnachittur authored Nov 3, 2023
1 parent 84d8c62 commit 41025d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- id: splinter
name: Splinter
entry: ./splinter
language: script
description: Simple pattern-based linter
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on any Unix.

Define your rules in
<br>
a file as a list of
a text file as a list of
<br>
message/regex pairs.

Expand Down Expand Up @@ -53,4 +53,18 @@ message/regex pairs.
src/foobar.test.js:130:Use `assert.strictEqual()` instead of `assert.equal()`
```

### Running with pre-commit

You can also set up this repo as a [pre-commit hook](https://pre-commit.com/). For example:

```yaml
- repo: https://github.com/duolingo/splinter.git
rev: 1.3.1
hooks:
- id: splinter
args:
- config/splinter-rules-py.txt
files: \.py$
```

_Duolingo is hiring! Apply at https://www.duolingo.com/careers_

0 comments on commit 41025d3

Please sign in to comment.