Skip to content

Commit

Permalink
Merge pull request #16 from sergei-ivanov/system-pre-commit-hook
Browse files Browse the repository at this point in the history
Add system pre-commit hook
  • Loading branch information
mmicu authored Aug 17, 2021
2 parents 0413f59 + 334ed1d commit 7fdd8b6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
- id: editorconfig-checker
name: editorconfig-checker
name: 'Check .editorconfig rules'
description: '`editorconfig-checker` is a tool to check if your files consider your .editorconfig-rules.'
entry: ec
language: python
types: [text]
types: [ text ]
require_serial: true
- id: editorconfig-checker-system
name: 'Check .editorconfig rules'
description: 'Runs system executable of `editorconfig-checker` to lint text files according to `.editorconfig` rules'
language: system
entry: ec
types: [ text ]
require_serial: true
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,19 @@ repos:
alias: ec
```
The above hook is a python wrapper that automatically downloads and installs
[editorconfig-checker](https://editorconfig-checker.github.io/) binary.
If you manage your tools in some other way, for example, via [ASDF](https://asdf-vm.com/),
you may want to use an alternative pre-commit hook that assumes that
`ec` binary executable is already available on the system path:

```yaml
repos:
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: '' # pick a git hash / tag to point to
hooks:
- id: editorconfig-checker-system
alias: ec
```

See the [pre-commit docs](https://pre-commit.com/#pre-commit-configyaml---hooks) to check how to customize this configuration.

0 comments on commit 7fdd8b6

Please sign in to comment.