π» Contributingο
How to Contributeο
Thank you for wanting to contribute to this project! We look forward to working with you. Here is a basic set of guidelines for contributing to our project.
Please checkout the issues in the deeper repository or the individual repository you want to contribute to. You can also create a new issue regarding what you want to work on. Please follow the guidelines mentioned above while creating the issue. You will need to include the link to the issue while creating a Pull Request(PR).
Fork the relevant repository.
Make necessary changes to the repository taking into account the coding guidelines mentioned in the individual repositories. Some general guidelines include the use of βgit rebaseβ to organize commits and these instructions regarding commit messages:
Separate subjects from body with a blank line
Limit the subject line to 50 characters
Capitalize the subject line
Do not end the subject line with a period
Use the imperative mood in the subject line
After your work is complete, make a Pull Request from your repository to the-deep repository. Describe what you did in as much detail as possible. Furthermore, please link to the issue in the description.
Our development team will go through the pull request and merge them if they are satisfactory. They can also review the PR and ask for explanations/modifications.
Contributing to the Backendο
Python Coding Guidelines
Follow PEP 8.
Use 4 spaces β¦ . never tabs.
Multiple Imports
Avoid this
from .serializers import ProjectSerializer, ProjectMembershipSerializer
Do this
from .serializers import (
ProjectSerializer, ProjectMembershipSerializer
)
Write unit tests
FAQο
How to get a python shell [with django initialization]?
- docker-compose up -d - docker-compose exec web ./manage.py shell
Contributing to the FrontEndο
React
setState is an async function. If you need an action to be called after setState, it provides a second argument which accepts a callback.
Use immutable objects most of the time. Instead of mutating an object, use immutable-helpers.
If a re-render is expected after a value is changed, the value should be kept in this.state. If not, donβt keep it in this.state.
Redux store stores global states.
If possible, donβt instantiate objects and functions in render method. Also avoid writing complex logic in render method.
When setting a new state to component, you can only set attributes that need to be changed.
Internal Libraries
Use RestRequest for all REST api calls.
Use Form to validate form data.
DEEP React Best Practices
Most likely, you will never require jquery.
For JSX, if there is more than one attribute, the attributes must be broken down in multiple lines. All these attributes should be sorted in alphabetical order.
For imports, the absolute and relative imports must be spaced with a new line. All the default imports must be sorted alphabetically.
propTypes and defaultProps for React classes must be written at the top of the file, only after imports. The attributes should be sorted alphabetically.
Prefer decorators for Higher-Order Components
Always use selectors to access data from redux store. Some additional calculations can be performed in selectors and the calculations are cached if selectors are used.
Always use action creators to dispatch action to redux store and always use action types to define an action creator.