How To Contribute

Start contributing today!

Introduction

Below is the workflow for having your contribution accepted into the pattoo repository.

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a good first issue tag for issues that should be ideal for people who are not very familiar with the codebase yet * Assign an interesting existing issue to yourself. * If you created a discussion issue for a new feature or bugfix, then make sure it’s approved by a maintainer before assigning the issue to yourself.

  2. Fork the repository on GitHub in preparation for your changes

  3. Clone your GitHub repository to your local machine

  4. Add the original project as a remote repository git remote add upstream https://github.com/PalisadoesFoundation/pattoo-agent-snmp. Check everything is OK with git remote -v.

  5. Create a branch named after your issue like this using git checkout -b issue-789 where 789 is the number of your issue.

  6. Write code modifying this branch and commit your changes locally. An example of a proper git commit` message can be seen below:

    Make the example in CONTRIBUTING imperative and concrete ...
    
    Without this patch applied the example commit message in the CONTRIBUTING
    document is not a concrete example.  This is a problem because the
    contributor is left to imagine what the commit message should look like
    based on a description rather than an example.  This patch fixes the
    problem by making the example concrete and imperative.
    
    The first line is a real life imperative statement with a ticket number
    from our issue tracker.  The body describes the behavior without the patch,
    why this is a problem, and how the patch fixes the problem when applied.
    
    Resolves Issue: #123
    See also: #456, #789
    
  7. We periodically update the master branch of our code. To synchronize the latest changes from our main repository into your current branch do:

    git fetch upstream
    git merge upstream/master
    
  8. Read the documentation on how to setup and run tests.

  9. Write the necessary unit tests for your changes.

  10. Run all the tests to assure nothing else was accidentally broken

  11. Push your changes to your forked repository:

    git push origin issue-789
    
  12. Perform a pull request on GitHub.

  13. Bug the maintainer until it gets accepted and merged. :)

  14. Make sure to add yourself to CONTRIBUTORS.rst

Code Style Guide

For ease of readability and maintainability code for all pattoo projects must follow these guidelines. Code that does not comply will not be added to the master branch.

  1. All pattoo python projects use the Google Python Style Guide for general style requirements
  2. All pattoo python projects use the The Chromium Projects Python Style Guidelines for docstrings.
  3. Indentations must be multiples of 4 blank spaces. No tabs.
  4. All strings must be enclosed in single quotes.
  5. All code must be compliant with:
pylint
PEP8
PEP257
pydocstyle
pycodestyle
  1. In addition too being pylint compliant, the code must be PEP8 and PEP257 compliant too.
  2. There should be no trailing spaces in files

Guidelines to Remember

  • Always opt for the most pythonic solution to a problem
  • Avoid applying idioms from other programming languages
  • Import each module with its full path name. ie: from pack.subpack import module
  • Use exceptions where appropriate
  • Use doc strings
  • Try not to have returns at multiple points in a function unless they are failure state returns.
  • If you are in the middle of a development session and have to interrupt your work, it is a good idea to write a broken unit test about what you want to develop next. When coming back to work, you will have a pointer to where you were and get back on track faster.

Commits

The pattoo projects strive to maintain a proper log of development through well structured git commits. The links below offer insight and advice on the topic of commit messages:

  1. https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
  2. http://chris.beams.io/posts/git-commit/