🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
4.3 KiB

  1. # Contributing to SDL
  2. We appreciate your interest in contributing to SDL, this document will describe how to report bugs, contribute code or ideas or edit documentation.
  3. **Table Of Contents**
  4. - [Filing a GitHub issue](#filing-a-github-issue)
  5. - [Reporting a bug](#reporting-a-bug)
  6. - [Suggesting enhancements](#suggesting-enhancements)
  7. - [Contributing code](#contributing-code)
  8. - [Forking the project](#forking-the-project)
  9. - [Following the style guide](#following-the-style-guide)
  10. - [Running the tests](#running-the-tests)
  11. - [Opening a pull request](#opening-a-pull-request)
  12. - [Contributing to the documentation](#contributing-to-the-documentation)
  13. - [Editing a function documentation](#editing-a-function-documentation)
  14. - [Editing the wiki](#editing-the-wiki)
  15. ## Filing a GitHub issue
  16. ### Reporting a bug
  17. If you think you have found a bug and would like to report it, here are the steps you should take:
  18. - Before opening a new issue, ensure your bug has not already been reported on the [GitHub Issues page](https://github.com/libsdl-org/SDL/issues).
  19. - On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
  20. - Include details about your environment, such as your Operating System and SDL version.
  21. - If possible, provide a small example that reproduces your bug.
  22. ### Suggesting enhancements
  23. If you want to suggest changes for the project, here are the steps you should take:
  24. - Check if the suggestion has already been made on:
  25. - the [issue tracker](https://github.com/libsdl-org/SDL/issues);
  26. - the [discourse forum](https://discourse.libsdl.org/);
  27. - or if a [pull request](https://github.com/libsdl-org/SDL/pulls) already exists.
  28. - On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
  29. - Describe what change you would like to happen.
  30. ## Contributing code
  31. This section will cover how the process of forking the project, making a change and opening a pull request.
  32. ### Forking the project
  33. The first step consists in making a fork of the project, this is only necessary for the first contribution.
  34. Head over to https://github.com/libsdl-org/SDL and click on the `Fork` button in the top right corner of your screen, you may leave the fields unchanged and click `Create Fork`.
  35. You will be redirected to your fork of the repository, click the green `Code` button and copy the git clone link.
  36. If you had already forked the repository, you may update it from the web page using the `Fetch upstream` button.
  37. ### Following the style guide
  38. Code formatting is done using a custom `.clang-format` file, you can learn more about how to run it [here](https://clang.llvm.org/docs/ClangFormat.html).
  39. Some legacy code may not be formatted, as such avoid formatting the whole file at once and only format around your changes.
  40. For your commit message to be properly displayed on GitHub, it should contain:
  41. - A short description of the commit of 50 characters or less on the first line.
  42. - If necessary, add a blank line followed by a long description, each line should be 72 characters or less.
  43. For example:
  44. ```
  45. Fix crash in SDL_FooBar.
  46. This addresses the issue #123456 by making sure Foo was successful
  47. before calling Bar.
  48. ```
  49. ### Running the tests
  50. Tests allow you to verify if your changes did not break any behaviour, here are the steps to follow:
  51. - Before pushing, run the `testautomation` suite on your machine, there should be no more failing tests after your change than before.
  52. - After pushing to your fork, Continuous Integration (GitHub Actions) will ensure compilation and tests still pass on other systems.
  53. ### Opening a pull request
  54. - Head over to your fork's GitHub page.
  55. - Click on the `Contribute` button and `Open Pull Request`.
  56. - Fill out the pull request template.
  57. - If any changes are requested, you can add new commits to your fork and they will be automatically added to the pull request.
  58. ## Contributing to the documentation
  59. ### Editing a function documentation
  60. The wiki documentation for API functions is synchronised from the headers' doxygen comments. As such, all modifications to syntax; function parameters; return value; version; related functions should be done in the header directly.
  61. ### Editing the wiki
  62. Other changes to the wiki should done directly from https://wiki.libsdl.org/