Skip to content

Contribute

Knight Hat edited this page Nov 4, 2023 · 2 revisions

Table of Content

  1. General
  2. Code Format
  3. Git Commit Format

General

TL;DR: Be kind to each other

  1. Do

    • Be respectful: Treat all individuals with respect, regardless of their background, identity, or opinions.
    • Be inclusive: Welcome and include diverse perspectives, experiences, and ideas.
    • Be understanding: Seek to understand differing viewpoints and engage in constructive discussions.
    • Be mindful: Be mindful of the impact our words and actions have on others in the community.
  2. Don't

    • Harassment: Any form of harassment, discrimination, or offensive behavior is unacceptable and will not be tolerated.
    • Trolling: Deliberate and disruptive actions or comments with the intent to provoke or offend others.
    • Hateful speech: Use of derogatory or offensive language, slurs, or personal attacks.
    • Spam: Posting irrelevant or unsolicited content, including excessive self-promotion.

Code Format

Some of the code formats are included in the source code and can be loaded if you are using IntelliJ IDEA

  1. Use spaces for indent (FOUR spaces). Tab indent will be rejected at PR.
  2. Follow as close as possible to the existing code style and conventions.
    • Check out files in idea/ folder for details
  3. Be sure to write clear and concise code and documentation.
    • Do NOT build a pyramid (at most THREE nested statements are allowed).
    • Use easy to understand naming schemes
      • Capitalize first character of a word (except for the very first) if name contains multiple words
      • Abbreviation: err stands for "error", do not name it e
    • A function/method should only do ONE job.
    • A class is an idea of all functions/methods inside it.
  4. If you're adding new features or make significant changes, consider adding relevant tests.
  5. If you're fixing a bug, please provide steps to reproduce the issue if applicable.

Git Commit Format

  1. Keep the history as linear as possible.
  2. Avoid combining multiple classes to one commit.
  3. A commit is only about one change inside the class. Except when it affects multiple classes. (A concise commit message is required in this scenario)

Clone this wiki locally