Skip to content

Commit

Permalink
Add contributing guide and code of conduct (#1087)
Browse files Browse the repository at this point in the history
* contributing and code of conduct

* Update CONTRIBUTING.md

Credit to @NotStirred

* Update CONTRIBUTING.md

Co-authored-by: Maik Marschner <[email protected]>

* update to jdk17 and fix IntelliJ

Update guide to cover JDK17

Fix IntelliJ capitalisation.

* Attempt 2 IntelliJ fixing...

* IntelliJ capitalization

* Update CONTRIBUTING.md

Co-authored-by: Maik Marschner <[email protected]>

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Maik Marschner <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Maik Marschner <[email protected]>

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Maik Marschner <[email protected]>

* README hacking relocation part 1

* Compiler annotations

Co-authored-by: Maik Marschner <[email protected]>
Co-authored-by: Maximilian Stiede <[email protected]>
  • Loading branch information
3 people authored May 14, 2022
1 parent dfc82f5 commit cf10dd5
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 1 deletion.
135 changes: 135 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement via our
[Discord server][chunky-discord].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[chunky-discord]: https://discord.gg/VqcHpsF

140 changes: 139 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,139 @@
Thank you for wanting to contribute to Chunky! The easiset way to help is to report issues, please check first if your bug has already been reported.
# Contributing

Thank you for investing your time in contributing to our project! Any contribution you make will be reflected in Chunky; first within our development builds prior to stable release.

Read our [Code of Conduct](CODE_OF_CONDUCT.md) to keep our community approachable and respectable.

In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.

When contributing to this repository, please consider discussing significant changes you wish to make via an issue or the [#tech](https://discord.com/channels/541221265512464394/545374333883777037) channel on our [Discord server][chunky-discord] prior to making a change. Correcting spelling or grammar mistakes, or fixing minor bugs are not considered significant. A full rewrite, adding new features, etc. can be considered more significant changes.


## New contributor guide

To get an overview of the project, read the [README](README.md).

Chunky is split into four subprojects:

* chunky - the core rendering and GUI project
* lib - common code required by the other projects
* launcher - the launcher
* releasetools - tool used for packaging releases

Here are some resources to help you get started with open source contributions:

- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)


## Getting started

### Issues

#### Create a new issue

If you spot a problem with the docs, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a [new issue](https://github.com/chunky-dev/chunky/issues/new).

#### Solve an issue

Scan through our [existing issues](https://github.com/chunky-dev/chunky/issues) to find one that interests you. You can narrow down the search using `labels` as filters. If you are not sure where to start we have labelled some issues as [good first issues](https://github.com/chunky-dev/chunky/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. However, we would request that you double-check what PRs are open and whether another contributor is working on an issue already.

### Make Changes

#### Make changes in the UI

Click on the pencil icon at the top right of any text file (code, markdown, etc.) to make small changes such as a typo, sentence fixes, broken links, etc. Please [create a pull request](#pull-request) for a review.


#### Make (more significant) changes locally

IntelliJ Community Edition is recommended, get it [here](https://www.jetbrains.com/toolbox-app/)
- You'll want to download JetBrains Toolbox, and download `IntelliJ IDEA Community Edition` from there

##### Fork the project to your account
Go to https://github.com/chunky-dev/chunky, click on `Fork` (usually in the top right)

##### Clone the project.
with IntelliJ: `File` -> `New` -> `Project from Version Control`
- In the url put `https://github.com/GITHUB_USERNAME/chunky`
- You can also select a location to clone to here.

with GitHub desktop: `Clone a repository` -> select `URL`, paste `https://github.com/GITHUB_USERNAME/chunky`

with CLI: `git clone [email protected]:GITHUB_USERNAME/chunky.git` or (outdated) `git clone https://github.com/GITHUB_USERNAME/chunky`

##### Open the Project
From inside IntelliJ (if you cloned with IntelliJ you can likely skip this step)
- `File` -> `Open` -> Select the first `build.gradle` file within the cloned folder
(You may also select the folder containing the `build.gradle` file)

You may have to wait some time while IntelliJ indexes the project, and imports it. (The little loading bar in the bottom right)

##### Select the correct JDK version to use to build the project
Java 17 SDK (e.g. openjdk-17-jdk on Ubuntu):
- `File` -> `Project Structure` -> `Project` (should be the default)
- If IntelliJ detected your install: select the `SDK` dropdown, select a Java 17 JDK install
- If not: click `Edit`, then the little `+` at the top, `Add JDK` and find your Java 17 JDK install location (select the main jdk folder).
- Go back to the `Project` tab, and select the newly added jdk.

Add `se.llbit.util.annotation.Nullable` and `se.llbit.util.annotation.NotNull` to the compiler options of Intellij for IntelliSense recommendations
- `File` -> `Settings` -> `Build, Execution, Deployment` -> `Compiler` (select it, not the dropdown)
- Click `Configure annotations...`
- In the `Nullable` tab click the little `+` to add `Nullable (se.llbit.util.annotation)`
- In the `NotNull` tab click the little `+` to add `NotNull (se.llbit.util.annotation.)`
- Intellij must be restarted to update IntelliSense

##### Create a new branch for your change
In the bottom right of IntelliJ, there is a New Branch button, by default it will say `master`, select it, at the top select `New Branch`, and name it after what you're intending to fix. (ideally something very short, no more than a few words). eg: `fix_scene_tab_typo` or `fix-scene-tab-typo` is fine.
- Make sure the `Checkout branch` box is checked when creating a new branch (to actually change to it once it's created)

##### Make your change
Some useful IntelliJ keybindings to help you navigate around:
- `Ctrl + N`, Find a file (class) by name

##### Commit your changes
After making your changes, select the `Commit` button (looks like a green tick) in the top right
Select all the changes you want to make, and add a description of what you changed.

### Testing
Prior to making a Pull Request please test your changes. Within IntelliJ, you can build and run Chunky by clicking on the green arrow next to `chunky\src\java\se.llbit\chunky\main\Chunky.java:line64` assuming you have got IntelliJ setup correctly. At the time of writing, Chunky's gradlew version is 7.4.

To build Chunky externally, run the `gradlew` script in the project root directory. Gradle is set-up with a few main tasks:

* build - Build Chunky, documentation, and run tests.
* release - Build and save files ready for a release to a Chunky update site. Outputs to `build/release`
* buildReleaseJar - Build an installer JAR. Outputs to `build/installer`
* docs - Build the documentation. Outputs to `build/docs`
* install - Create a publishable maven repository for Chunky core. Outputs to `build/maven`
* clean - Cleans the project. Removes old builds.

A custom version can be specified with `-PnewVersion="<version>"`. A custom prerelease tag can be specified with `-PprereleaseTag="<tag>"`. The default version is in the format: `{major}.{minor}.{patch}-{tag (DEV)}.{commits since last tag}.g{git hash of commit}`


### Pull Request

When you're finished with the changes, create a pull request, also known as a PR.
- Provide a short but descriptive name and for more complex changes an extended description.
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information.
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
- If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues.

If you get stuck at any point along your PR journey, do not hesitate to ask for help or opinions on Discord or in the PR's discussion. We appreciate your contribution and want it to be merged as much as you do. 😉

### Your PR is merged!

Congratulations :tada::tada: The Chunky team thanks you :sparkles:.

Once your PR is merged, your contributions will be publicly available in the next Chunky snapshot and eventually ship in a stable release.

# Attribution

This Contributing guide is adapted from the [GitHub docs](https://docs.github.com/en) [contributing guide](https://github.com/github/docs/blob/main/CONTRIBUTING.md).

[chunky-discord]: https://discord.gg/VqcHpsF

0 comments on commit cf10dd5

Please sign in to comment.