CONTRIBUTING.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Contributing Code
  2. -----------------
  3. A good pull request:
  4. - Is clear.
  5. - Works across all supported versions of Python.
  6. - Follows the existing style of the code base (see Codestyle section).
  7. - Has comments included as needed.
  8. - A test case that demonstrates the previous flaw that now passes with
  9. the included patch, or demonstrates the newly added feature.
  10. - If it adds/changes a public API, it must also include documentation
  11. for those changes.
  12. - Must be appropriately licensed (Apache 2.0).
  13. Reporting An Issue/Feature
  14. --------------------------
  15. First, check to see if there's an existing
  16. `issue <https://github.com/boto/botocore/issues>`__/`pull requests <https://github.com/boto/botocore/pulls>`__ for the bug/feature.
  17. If there isn't an existing issue there, please file an issue *first*. The
  18. ideal report includes:
  19. - A description of the problem/suggestion.
  20. - How to recreate the bug.
  21. - If relevant, including the versions of your:
  22. - Python interpreter
  23. - s3transfer
  24. - Optionally of the other dependencies involved (e.g. Botocore)
  25. - If possible, create a pull request with a (failing) test case
  26. demonstrating what's wrong. This makes the process for fixing bugs
  27. quicker & gets issues resolved sooner.
  28. Codestyle
  29. ---------
  30. This project uses flake8 to enforce codstyle requirements. We've codified this
  31. process using a tool called `pre-commit <https://pre-commit.com/>`__. pre-commit
  32. allows us to specify a config file with all tools required for code linting,
  33. and surfaces either a git commit hook, or single command, for enforcing these.
  34. To validate your PR prior to publishing, you can use the following
  35. `installation guide <https://pre-commit.com/#install>`__ to setup pre-commit.
  36. If you don't want to use the git commit hook, you can run the below command
  37. to automatically perform the codestyle validation:
  38. .. code-block:: bash
  39. $ pre-commit run
  40. This will automatically perform simple updates (such as white space clean up)
  41. and provide a list of any failing flake8 checks. After these are addressed,
  42. you can commit the changes prior to publishing the PR.
  43. These checks are also included in our CI setup under the "Lint" workflow which will provide output on Github for anything missed locally.
  44. See the `flake8` section of the
  45. `setup.cfg <https://github.com/boto/s3transfer/blob/develop/setup.cfg>`__ for the
  46. currently enforced rules.