Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 3.43 KB

CONTRIBUTING.md

File metadata and controls

64 lines (42 loc) · 3.43 KB

Contribution guidelines

Before you create a pull request, please review the following guidelines for your contribution. Thank you in advance.

Your files use tab indendation (keep tabs) of size 4

In our project, we use tab indentation with a size of 4. Please have your settings abide this rule.

Note: Most editors support our provided .editorconfig file, but certain functionalities (for example ones provided by plugins or addons) sometimes do not abide it. Please be careful and considerate with your actions!

For Visual Studio:

Tools -> Options
Text Editor -> C# -> Tabs
Settings:
	Indenting: Smart
	Tab size: 4
	Indent size: 4
	Keep tabs CHECKED

Example Visual Studio

For Notepad :

Tools -> Preferences
Language -> C#
Settings:
	[Default]
	Tab size: 4
	Replace by space UNCHECKED

Example notepad

If you use another editor, please find these settings yourself and adjust them accordingly.

You edit in the tModLoader solution

The chance is very slim that you need either of the other workspaces. If you did use them, please be absolutely sure that you had to work in them. If you are unsure, feel free to ask us before proposing your contribution.

To open this workspace, navigate to solutions/ and open tModLoader.sln

Example solution

You use our code patcher, so you only commit patches

In this project we work with our own code patcher. This is so that we do not publish the entire Terraria codebase (which isn't allowed), but we can still open-source our code.

To open our code patcher, run setup.bat from the main directory. If you've worked in the tModLoader workspace, you press 'Diff tModLoader' This will create new patches containing your changes in the patches/ folder

Example patcher

You can still commit other files if needed for example if you updated translations or sprites, but in general you should only commit patches.

You inspect your diffs (patches)

Before you propose your contribution, inspect your patches. Please make sure that file formatting didn't mess up (this can happen with certain plugins and addons!)

Diff example

Make sure your patch is as small as possible, so try to introduce as little changes as possible. Sometimes this may require some additional thoughts about changes you make, and you may prefer a different approach to ensure a small patch difference.

For formatting it can help if your formatting tool supports our .editorconfig file. Ensure you have the same indentation levels, braces on the same line etc.

Helpful tips for contributions

Because tModLoader is a big project, we want to make sure contributions don't introduce unnecessary code or code that is fundamentally flawed by design. But please don't be discouraged! If you are unsure about your contribution, still feel free to propose it and in your proposal ask us for feedback. If you do, please add "WIP:" in the title of your proposal. It is also helpful if you are specific about what you want feedback on. We will always try to provide you feedback in a passive and helpful manner.