Skip to content

Commit 2d7e4c9

Browse files
author
matthias_schaub
committed
add style guide
1 parent 5bb24c9 commit 2d7e4c9

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

docs/source/contributing.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,46 @@
11
# Contributing
22

3-
This document is a work progress. It should describe how to contribute (code or issues) to the MapSwipe back-end.
43

5-
To contribute to the MapSwipe back-end please create dedicated feature branches.
4+
## Clone from GitHub
5+
6+
```bash
7+
git clone https://github.com/mapswipe/python-mapswipe-workers.git
8+
cd python-mapswipe-workers
9+
git checkout dev
10+
```
11+
12+
13+
## Install MapSwipe Workers
14+
15+
Create a Python virtual environment and activate it. Install MapSwipe Workers using pip:
16+
17+
```bash
18+
python -m venv venv
19+
source venv/bin/activate
20+
pip install --editable .
21+
```
22+
23+
24+
## Feature Branch
25+
26+
To contribute to the MapSwipe back-end please create dedicated feature branches:
627

728
```bash
829
git checkout -b featureA
930
git commit -am 'add new project type'
1031
git push -u origin featureA
1132
git request-pull origin/master featureA
1233
```
34+
35+
36+
## Style Guide
37+
38+
This project uses [black](https://github.com/psf/black) and [flake8](https://gitlab.com/pycqa/flake8) to achieve a unified style.
39+
40+
Use [pre-commit](https://pre-commit.com/) to run `black` and `flake8` prior to any git commit. `pre-commit`, `black` and `flake8` should already be installed in your virtual environment since they are listed in `requirements.txt`. To setup pre-commit simply run:
41+
42+
```
43+
pre-commit install
44+
```
45+
46+
From now on `black` and `flake8` should run automatically whenever `git commit` is executed.

0 commit comments

Comments
 (0)