> For the complete documentation index, see [llms.txt](https://phoenix-7.gitbook.io/nodechain-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phoenix-7.gitbook.io/nodechain-en/develop/how-to/lint-automatically-with-hooks.md).

# Lint automatically with hooks

Follow the steps to create a pre-commit hook

1. Create the file `pre-commit` inside the path `.git/hooks/` of your local repository with this content:

```bash
#!/bin/bash

ROOT_DIR="$(git rev-parse --show-toplevel)"

echo "Running Flake8"
flake8 ${ROOT_DIR} --statistics
```

1. Assign it execution permission

```shell
$ chmod +x .git/hooks/pre-commit
```
