Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

txtred='\e[0;31m'
txtbld='\e[1m'
txtrst='\e[0m'

if ! flake8 src/ po/
then
echo -e "${txtred}${txtbld}Linter error(s) from flake8${txtrst}"
exit 1
fi

if ! mypy src/ po/
then
echo -e "${txtred}${txtbld}Linter error(s) from mypy${txtrst}"
exit 1
fi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Translation: update Portuguese translation (@hugok79)
- Translation: add 'nl' in LINGUAS (@hugok79)
- Update pypi packages (@MightyCreak)
- Add pre-commit git hooks to run linters (@MightyCreak)

## 0.9.0 - 2024-01-13

Expand Down
10 changes: 10 additions & 0 deletions docs/developers/developers-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ Diffuse depends on these projects:
* Meson
* Flatpak and Flatpak builder (Linux only)

### Install git hooks (optional)

There is a pre-commit git hook that runs some linters on the source code before committing.

To install the git hooks (for the repository only), run this command:

```sh
git config --local core.hooksPath ./.githooks
```

## Install the dependencies

### Install the system dependencies
Expand Down