Contributing

Want to contribute with Localshop? Great! We really appreciate your help. But before digging into your new fluffy-next-millionaine-feature code keep in mind that you MUST follow this guide to get your pull requests approved.

Get started

  1. Fork the project and follow the installation instructions [1].
  2. Your code MUST contain tests. This is a requirement and no pull request will be approved if it lacks tests. Even if your’re making a small bug fix we want to ensure that it will not introduce any another bug.
  3. Help to keep the documentation up-to-date is really appreaciated. Always check if your’re making changes that make the documentation obsolete and update it.
  4. Squash your commits before making a pull request whenever possible. This will avoid history pollution with middle commits that breaks things. Your pull request should be a single commit with all your changes.
  5. Open a pull request. Usually, the target branch at the main repository will be develop, but if your’re sending a bugfix to avoid the extinction of human race, maybe you want to target the master branch.

Tip

Use a meaningful and convincing pull request description. Feel free to use emojis to give us a clue of what kind changes your’re making. The Style guide contains some of our preferred ones.

Style guide

  • Follow the PEP8. The only exception is the maximum line width. We uses 120 characters instead of 79.

  • Make sure that your code does not raises any Pylint errors or warnings.

  • Always group the imports in 3 blocks: native libraries, third party libraries and project imports.

  • Keep the import block alphabetically ordered. If you use Sublime Text, you can do this by selecting the import block and hitting F9

  • Avoid polluting the current namespace with lots of imports. If you find yourself in a situation of importing a lot of symbols from the same package, consider import the package itself.

    Wrong way:

    from django.core.exceptions import (ImproperlyConfigured, AppRegistryNotReady, FieldError, DisallowedHost,
                                        DisallowedRedirect, DjangoRuntimeWarning)
    

    Preferred way:

    from django.core import exceptions as djexc
    

Commit messages

  • Limit the first line to 72 characters or less

  • Always use English

  • Consider starting the commit message with an applicable emoji:
    • lipstick :lipstick: when improving the format/structure of the code
    • fire :fire: when removing code or files
    • bug :bug: when fixing a bug
    • beetle :beetle: when fixing a bug
    • book :book: when writing docs
    • green_heart :green_heart: when fixing the CI build
    • white_check_mark :white_check_mark: when adding tests
    • x :x: when commiting code with failed tests
    • arrow_up :arrow_up: when upgrading dependencies
    • arrow_down :arrow_down: when downgrading dependencies

Footnotes

[1]Installing