2. Contributing - EmulairEmulator/Emulair-Lemuroid-clone GitHub Wiki

Contributing Guidelines

This guide was inspired by jessesquires's CONTRIBUTING.md.

Contents

Note: This guide serves to set some expectations for anyone involved with Emulair so that we can improve it together while also creating a welcoming space for everyone to participate. Following these guidelines will help ensure a positive experience for contributors and maintainers.

Code of Conduct

Simply following GitHub's community code of conduct should be enough.

Asking Questions

Asking code related questions should be done by opening an issue. Asking any other questions should be done via discussions.

Opening an Issue

A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate a well-written, thorough bug report.

Before creating an issue, check if you are using the latest version of the project. If you are not up-to-date, see if updating fixes your issue first.

In short, since you are most likely a developer, provide a ticket that you would like to receive:

  • Review the code documentation before opening a new issue.
  • Do not open a duplicate issue. Search through existing issues to see if your issue has previously been reported. If your issue exists, comment with any additional information you have. You may simply note "I have this problem too", which helps prioritize the most common problems and requests.
  • Prefer using reactions, not comments, if you simply want to "+1" an existing issue.
  • Currently, we do not have a bug report/issue template, but may have one in the future.
  • Use GitHub-flavored Markdown. Especially put code blocks and console outputs in backticks (```). This improves readability.

Feature Requests

Feature requests are welcome! While we will consider all requests, we cannot guarantee your request will be accepted. We want to avoid feature creep. Your idea may be great, but also out-of-scope for the project. If accepted, we cannot make any commitments regarding the timeline for implementation and release. However, you are welcome to submit a pull request to help!

Also, please, do not open a duplicate feature request. Search for existing feature requests first. If you find your feature (or one very similar) previously requested, comment on that issue. And be precise about the proposed outcome of the feature and how it relates to existing features. Include implementation details if possible.

Submitting Pull Requests

We love pull requests! Before forking the repo and creating a pull request for non-trivial changes, it is usually best to first open an issue to discuss the changes, or discuss your intended approach for solving the problem in the comments for an existing issue.

For most contributions, after your first pull request is accepted and merged, you will be invited to the project and given push access.

Note: All contributions will be licensed under the project's license.

When submitting a pull request, keep in mind the following:

  • Smaller is better. Submit one pull request per bug fix or feature. A pull request should contain isolated changes pertaining to a single bug fix or feature implementation. Do not refactor or reformat code that is unrelated to your change. It is better to submit many small pull requests rather than a single large one. Enormous pull requests will take enormous amounts of time to review, or may be rejected altogether.
  • Coordinate bigger changes. For large and non-trivial changes, open an issue to discuss a strategy with the maintainers. Otherwise, you risk doing a lot of work for nothing!
  • Prioritize understanding over cleverness. Write code clearly and concisely. Remember that source code usually gets written once and read often. Ensure the code is clear to the reader. The purpose and logic should be obvious to a reasonably skilled developer, otherwise you should add a comment that explains it.
  • Follow existing coding style and conventions. Keep your code consistent with the style, formatting, and conventions in the rest of the code base. When possible, these will be enforced with a linter. Consistency makes it easier to review and modify in the future.
  • Add documentation. Document your changes with code doc comments or in existing guides.
  • Use the repo's main branch. Branch from and submit your pull request to the repo's default branch.
  • Resolve any merge conflicts that occur.
  • When writing comments, use clear, properly constructed sentences.
  • Use spaces, not tabs.

Writing Commit Messages

Please write a great commit message by following those steps:

  1. Use the imperative mood in the subject line (example: "Fix networking issue").
  2. Use the body to explain why, not what and how (the code shows that!).
  3. Note the fixed or relevant GitHub issues at the end, if any (e.g. Resolves: #123 or See also: #456, #789).

Code Review

  • Review the code, not the author. Look for and suggest improvements without disparaging or insulting the author. Provide actionable feedback and explain your reasoning.
  • You are not your code. When your code is critiqued, questioned, or constructively criticized, remember that you are not your code. Do not take code reviews personally.
  • Always do your best. No one writes bugs on purpose. Do your best, and learn from your mistakes.
  • Kindly note any violations to the guidelines specified in this document.

Coding Style

Consistency is the most important. Following the existing style, formatting, and naming conventions of the file you are modifying and of the overall project are essential. Failure to do so will result in a prolonged review process that has to focus on updating the superficial aspects of your code, rather than improving its functionality and performance.

For example, if all private properties are prefixed with an underscore _, then new ones you add should be prefixed in the same way. Or, if methods are named using camelcase, like thisIsMyNewMethod, then do not diverge from that by writing this_is_my_new_method. You get the idea. If in doubt, please ask or search the codebase for something similar.

When possible, style and format will be enforced with a linter.

Certificate of Origin

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

  1. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
  2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
  3. The contribution was provided directly to me by some other person who certified (1), (2) or (3) and I have not modified it.
  4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

Credits

Originally written by @jessesquires. Adapted by the Emulair devs.

Please feel free to adopt this guide in your own projects. Fork it wholesale or remix it for your needs.

Many of the ideas and prose for the statements in this document were based on or inspired by work from the following communities:

We commend them for their efforts to facilitate collaboration in their projects.