Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Latest commit

 

History

History
88 lines (60 loc) · 2.33 KB

CONTRIBUTING.md

File metadata and controls

88 lines (60 loc) · 2.33 KB

Contributing to django-vditor

First off, thanks for taking the time to contribute! Contributions include but are not restricted to:

  • Reporting bugs
  • Contributing to code
  • Writing tests
  • Writing documents

The following is a set of guidelines for contributing.

A recommended flow of contributing to an open source project.

This guideline is for new beginners of OSS. If you are an experienced OSS developer, you can skip this section.

  1. First, fork this project to your own namespace using the fork button at the top right of the repository page.

  2. Clone the upstream repository to local:

    $ git clone https://github.com/pi-dal/django-vditor.git
    # Or if you prefer SSH clone:
    $ git clone [email protected]:pi-dal/django-vditor.git
    # Or if you prefer gh repo:
    $ gh repo clone pi-dal/django-vditor
  3. Add the fork as a new remote:

    $ git remote add fork https://github.com/yourname/django-vditor.git
    $ git fetch fork

    where fork is the remote name of the fork repository.

ProTips:

  1. Don't modify code on the dev branch, the dev branch should always keep track of origin/dev.

    To update dev branch to date:

    $ git pull origin dev
    # In rare cases that your local dev branch diverges from the remote dev:
    $ git fetch origin && git reset --hard dev
  2. Create a new branch based on the up-to-date dev for new patches.

  3. Create a Pull Request from that patch branch.

Local development

First, install package management tools pdm.

# If you are on MacOS and using homebrew, install it by:
$ brew install pdm
# Otherwise, it is recommended to install pdm in an isolated environment with pipx:
$ pipx install pdm
# Or you can install it under a user site:
$ pip install --user pdm

Then, configure the shell according to the document.

Finally, You need to use pdm to install development dependencies:

$ pdm sync -d

Test code coverage

In fact, when you install the development dependency, you already have coverage installed, but if you are installing it in another way, please install it first:

$ pdm add -d coverage 

Then, use coverage to start testing code coverage:

$ python3 -m coverage run manage.py test
# Get XML file
$ python3 -m coverage xml