Skip to content

Commit 2ee901f

Browse files
authored
Merge pull request #27 from torchbox/improve-developer-documentation
Improve developer documentation
2 parents ddcb329 + 98552aa commit 2ee901f

File tree

6 files changed

+77
-25
lines changed

6 files changed

+77
-25
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ dist/
77
.python-version
88
.coverage
99
.venv
10+
venv

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
default_language_version:
2+
node: system
3+
python: python3.9
14
repos:
25
- repo: https://github.com/python/black
36
rev: 22.3.0
47
hooks:
58
- id: black
6-
language_version: python3.8
79
exclude: migrations/
810
- repo: https://github.com/timothycrosley/isort
911
rev: 5.12.0
1012
hooks:
1113
- id: isort
12-
language_version: python3.8
1314
- repo: https://github.com/pycqa/flake8
1415
# flake8 config is in setup.cfg
1516
rev: 6.0.0
1617
hooks:
1718
- id: flake8
18-
language_version: python3.8
1919
- repo: https://github.com/pre-commit/mirrors-prettier
2020
rev: v2.3.2
2121
hooks:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
7+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [Unreleased]

README.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![tests](https://github.com/kevinhowbrook/wagtail-jotform/workflows/Tests/badge.svg)
1+
![tests](https://github.com/torchbox/wagtail-jotform/workflows/Tests/badge.svg)
22
[![codecov](https://codecov.io/gh/kevinhowbrook/wagtail-jotform/branch/master/graph/badge.svg?token=GBDM9H1A2X)](https://codecov.io/gh/kevinhowbrook/wagtail-jotform)
33
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Total alerts](https://img.shields.io/lgtm/alerts/g/kevinhowbrook/wagtail-jotform.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kevinhowbrook/wagtail-jotform/alerts/)
44

@@ -12,7 +12,7 @@ Wagtail Jotform works by providing a new `EmbeddedFormPage` page type with a for
1212

1313
Install from [pypi](https://pypi.org/project/wagtail-jotform/):
1414

15-
```
15+
```bash
1616
pip install wagtail-jotform
1717
```
1818

@@ -52,29 +52,21 @@ When a form is created, the Jotform `thankurl` is set with your created form's t
5252

5353
Wagtail Jotform has two templates:
5454

55-
```
56-
embedded_form_page.html
57-
thank_you.html
58-
```
55+
- embedded_form_page.html
56+
- thank_you.html
5957

6058
You can override these templates in your project by adding them in the following location:
6159

62-
```
63-
your_project_root/
64-
templates/
65-
wagtail_jotform/
66-
embed_form_page.html
67-
thank_you.html
68-
```
60+
- your_project_root/
61+
- templates/
62+
- wagtail_jotform/
63+
- embed_form_page.html
64+
- thank_you.html
6965

70-
## Tests
66+
## Contributing
7167

72-
```
73-
# Install the development environment
74-
poetry install
75-
poetry shell
68+
We welcome contributions to this project. Please follow the [contributing instructions](docs/CONTRIBUTING.md) to get started.
7669

77-
# Run the tests
78-
coverage run ./runtests.py
79-
coverage report
80-
```
70+
## Release process
71+
72+
To release a new version, the [Release documentation](docs/RELEASE.md) should be followed.

docs/CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing
2+
3+
Contributions are welcome, please follow the setup instructions below to get started.
4+
5+
## Setup
6+
7+
### Clone the repository
8+
9+
```bash
10+
git clone https://github.com/torchbox/wagtail-jotform
11+
```
12+
13+
### Create a virtual environment and install the requirements
14+
15+
```bash
16+
cd wagtail-jotform
17+
python3 -m venv venv
18+
source venv/bin/activate
19+
pip install -e ".[testing,development]"
20+
```
21+
22+
### Install the pre-commit hooks
23+
24+
```bash
25+
pre-commit install
26+
```
27+
28+
### Do some work, write some tests
29+
30+
Change some code, write some tests, and check that the tests pass
31+
32+
### Run the tests
33+
34+
```bash
35+
coverage run ./runtests.py
36+
coverage report
37+
```

docs/RELEASE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Release
2+
3+
The release process is run with github actions. To release a new version:
4+
5+
1. Update the version number in `wagtail_jotform/__init__.py`
6+
7+
2. Update the changelog in `docs/CHANGELOG.md`
8+
9+
3. Commit and push the changes
10+
11+
4. Create a new release in github, with the tag name `X.X.X` and the release title `X.X.X`
12+
13+
5. The release will be built and published to pypi automatically

0 commit comments

Comments
 (0)