-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.md
64 lines (47 loc) · 1.8 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Autohooks
```{image} _static/greenbone.png
:alt: Greenbone Logo
:width: 300px
:target: ""
:class: greenbone-logo
````
Library for managing and writing [git hooks](https://git-scm.com/docs/githooks)
in Python.
Looking for automatic formatting or linting, e.g., with [black] and [pylint],
while creating a git commit using a pure Python implementation?
Welcome to **autohooks**!
## Why?
Several outstanding libraries for managing and executing git hooks exist already.
To name a few: [husky](https://github.com/typicode/husky),
[lint-staged](https://github.com/okonet/lint-staged),
[precise-commits](https://github.com/nrwl/precise-commits) or
[pre-commit](https://github.com/pre-commit/pre-commit).
However, they either need another interpreter besides python (like husky) or are
too ambiguous (like pre-commit). pre-commit is written in Python but has support
hooks written in all kind of languages. Additionally, it maintains the dependencies by
itself and does not install them in the current environment.
## Solution
autohooks is a pure Python library that installs a minimal
[executable git hook](https://github.com/greenbone/autohooks/blob/main/autohooks/precommit/template).
It allows the decision of how to maintain the hook dependencies
by supporting different [modes](./modes.md).
![Autohooks](https://raw.githubusercontent.com/greenbone/autohooks/main/autohooks.gif)
## Requirements
Python 3.7+ is required for autohooks. It depends on [tomlkit](https://github.com/sdispater/tomlkit/),
[pontos](https://github.com/greenbone/pontos) and [rich](https://github.com/Textualize/rich/).
```{toctree}
:hidden:
quickstart
installation
configuration
modes
plugins
```
```{toctree}
:caption: Development
:hidden:
create
api
```
[black]: https://black.readthedocs.io/en/stable/
[pylint]: https://pylint.readthedocs.io/en/latest/