Skip to content

Commit

Permalink
Add Documentation for Code Formatting and Testing (#1667)
Browse files Browse the repository at this point in the history
* Document steps to contribute that are specific to plone.restapi

* changes index.md

---------

Co-authored-by: David Glick <david@glicksoftware.com>
  • Loading branch information
Akshat2Jain and davisagli committed Jul 12, 2023
1 parent 2100a45 commit 869ad6d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
28 changes: 25 additions & 3 deletions docs/source/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ myst:

# Contributing to `plone.restapi`

We use GNU `make` when developing `plone.restapi`.
To install this package, its dependencies, and its documentation, code formatting, and testing tools, run the following command in the root of the project.

```shell
make
```

## Generating documentation examples

Expand Down Expand Up @@ -37,7 +43,6 @@ Include them in the documentation using MyST syntax:
Build the documentation locally to test the rendering by running `./bin/sphinxbuilder`.
Alternatively, you can use Makefile targets:


`docs-clean`
: Clean current and legacy docs build directories, and Python virtual environment

Expand All @@ -58,9 +63,8 @@ Alternatively, you can use Makefile targets:

`docs`
: Build Docs

Make sure you add and commit the generated files in `http-examples`.

Make sure you add and commit the generated files in `http-examples`.

## Conventions

Expand All @@ -69,3 +73,21 @@ Make sure you add and commit the generated files in `http-examples`.
conventions
```

## Code formatting and testing

To ensure consistent code formatting, we use [Black](https://black.readthedocs.io/en/stable/index.html).
All pull requests must pass code formatting checks.
We recommend that you run Black locally.
You can use the following command to automatically format the code.

```shell
make black
```

To run tests locally and ensure your changes don't introduce any issues, use the following command.
This will execute the test suite and provide test feedback.

```shell
make test
```
1 change: 1 addition & 0 deletions news/1664.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
added instruction to ensure consistent code formatting. @Akshat2Jain

0 comments on commit 869ad6d

Please sign in to comment.