-
-
Notifications
You must be signed in to change notification settings - Fork 79
First Pull Request
How to submit a pull request:
- 1. Create a GitHub Account
- 2. Install Git
- 3. Fork the Project
- 4. Clone your Fork
- 5. Create a New Branch
- 6. Run ScanAPI locally
- 7. Make your changes
- 8. Test your changes
- 9. Commit and push your changes
- 10. Add changelog entries
- 11. Create a GitHub PR
- 12. Update you branch if needed.
Make sure you have a GitHub account
Make sure you have Git installed
Clone your fork locally
Go into the ScanAPI folder:
$ cd scanapi
And create a new branch:
$ git checkout -b <issue_number>
Now is the step where you can implement your changes in the code.
It is important to notice that we document our code using docstrings. Modules, classes, functions, and methods should be documented. Your changes should also be well documented and should reflect updated docstrings if any of the params were changed for a class/attributes or even functions.
We follow the given pattern below to keep consistency in the docstrings:
class Example:
"""Explain the purpose of the class
Attributes:
spec[dict]: Short explanation here
parent[type, optional]: Short explanation here
"""
def __init__(self, spec, parent=None):
self.spec = spec
self.parent = parent
def foobar(self, field_name):
"""Purpose if the function
Args:
field_name[str]: Short explanation here
Returns:
value[str]: Short explanation here
"""
value = field_name.get('node')
return value
One last thing to keep in mind while self-documenting code with docstrings that you can ignore docstrings in property decorators and magic methods.
Make sure you have created the necessary tests for every new change you made. Please, visit the page Writing Tests to find the instructions of how to create tests
Run all the tests and make sure that they all passed.
PRs will not be merged if there is any test missing or failing.
Commit the changes:
$ git commit -a -m "<commit_message>"
We encourage you to follow these rules to write great commit messages: https://www.conventionalcommits.org/en/v1.0.0/
Push your commit to GitHub
$ git push --set-upstream origin <issue_number>
Create the number of changes/commits you need and push them.
Make sure your branch is updated with master