Skip to content

Commit

Permalink
Add pre-commit lint hook for local dev (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
faebebin authored Sep 1, 2022
1 parent ade600c commit 907eaaf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
exclude = */docs/*,*/.tox/*,*/.venv/*,*/.pycharm_helpers/*,*/migrations/*,docs/*,*/__init__.py,
*/manage.py,*/wsgi.py,
*/manage.py,*/wsgi.py,*/django.wsgi,
# we don't check this for now, until it's been fixed. otherwise it will throw lot of errors
qgis-app/plugins/*,
qgis-app/userexport/*,
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Lint files
- repo: https://gitlab.com/pycqa/flake8
rev: "3.9.0"
hooks:
- id: flake8

12 changes: 12 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ and now, you can see your site at `http://0.0.0.0:62202` (skip this step if you

---

### Setup git-hooks and local linting

In the root directory of the repo, run:

```bash
pip install -r REQUIREMENTS-dev.txt

pre-commit install --config .pre-commit-config.yaml
```

---

### Setting up a remote interpreter in PyCharm

- PyCharm -> Preferences -> Project: QGIS-Django
Expand Down
1 change: 1 addition & 0 deletions REQUIREMENTS-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
flake8
pre-commit

0 comments on commit 907eaaf

Please sign in to comment.