Skip to content

Commit c15230a

Browse files
committed
contributing.md - update
1 parent 4caa22a commit c15230a

1 file changed

Lines changed: 51 additions & 5 deletions

File tree

.github/contributing.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Contributing to HySkript
22

33
> [!IMPORTANT]
4-
> This document is a work in progress.
4+
> This document is a work in progress.
5+
> Please check back regularly.
56
67
## Branches:
78
- `master` = Current release only
@@ -23,13 +24,18 @@ This way the team can discuss with you whether or not we want this in HySkript.
2324
- Use descriptive commit messages
2425
- Use descriptive PR titles
2526
- Ensure you follow the code style of this project
27+
- Do make sure you add tests and run the test to make sure it works.
28+
- See the [Testing Guide](https://github.com/SkriptDev/HySkript/tree/master/src/test/README.md) for more information.
2629

2730
### Don't:
2831
- Don't commit directly to `master`
2932
- Don't use reflection (Hytale is pretty open)
3033
- We won't accept PRs that are just string-based changes. Your PR contribution should be code-based. (If you find a typo, report it and/or let one of the team members know.)
3134
- If a class seems outdated (in terms of formatting) please do not reformat the entire class for small changes (it makes PRs really difficult to read).
3235
- Don't break any current syntaxes (ie: removing/changing a pattern with a breaking change).
36+
- No chained expressions. These are really hard on the parser.
37+
- Think of regular Skript and their ItemType chains
38+
- Ex: `diamond sword of unbreaking 3 named "name" with lore "lore" with custom model data 1 .....`
3339

3440
## Code Style:
3541
### Formatting:
@@ -44,12 +50,12 @@ This way the team can discuss with you whether or not we want this in HySkript.
4450

4551
### Naming
4652
- Class names are written in UpperCamelCase
47-
- The file name should match its primary class name (e.g. `MyClass` goes in `MyClass.java.`)
53+
- The file name should match its primary class name (e.g. `MyClass` goes in `MyClass.java.`)
4854
- Fields and methods named in `camelCase`.
49-
- Static constant fields should be named in `UPPER_SNAKE_CASE`
55+
- Static constant fields should be named in `UPPER_SNAKE_CASE`
5056
- Use prefixes only where their use has been already established (such as `ExprSomeRandomThing`)
51-
- Otherwise, use postfixes where necessary
52-
- Common occurrences include: Struct (Structure), Sec (Section), Eff (Effect), Cond (Condition), Expr (Expression)
57+
- Otherwise, use postfixes where necessary
58+
- Common occurrences include: Struct (Structure), Sec (Section), Eff (Effect), Cond (Condition), Expr (Expression)
5359
- Ensure variable/field names are descriptive.
5460

5561
### Syntax Docs:
@@ -60,3 +66,43 @@ This way the team can discuss with you whether or not we want this in HySkript.
6066
- For expressions, please provide an example of using the getter as well as each changer you have applied.
6167
- For all others, please provide at least one example per pattern.
6268
- Please see other examples in HySkript for further inspiration.
69+
70+
## Registration:
71+
### Types:
72+
When registering a type, please first think about the type.
73+
Also make sure to always include a name, description and since (see above).
74+
Examples are not mandatory as they're often included in the expressions/effects/etc.
75+
76+
#### Asset Store Types:
77+
There is a registration specifically for asset store types.
78+
`SkriptRegistration#newAssetStoreType`
79+
This one specifally includes a parser, supplier and toString methods.
80+
They don't include serializers as Hytale may change these assets at any time.
81+
82+
#### Enum Types:
83+
There is a registration specifically for enum types.
84+
`SkriptRegistration#newEnumType`
85+
This one specifally includes a parser, supplier and toString methods.
86+
They don't include serializers as the enums could change at any point.
87+
88+
#### Others:
89+
For all othrers you can register a new type.
90+
`SkriptRegistration#newType`
91+
By default nothing is included, so make sure to add what you feel is appropriate
92+
such as a parser, toString methods, serializer, etc.
93+
94+
### Custom Type Classes:
95+
Custom type classes are highly discouraged.
96+
97+
#### Exceptions:
98+
Sometimes a custom type class is required.
99+
A simple example in HySkript is the `Block` type class.
100+
Hytale does not provide any reference to an actual block in the world.
101+
Because of this, a custom block class was necessary.
102+
103+
#### Before:
104+
If you feel a custom class is necessary, please discuss it with the team first.
105+
Its better to get a yes/no before writing up a whole PR and having it turned down.
106+
107+
## Tests:
108+
See the [Testing Guide](https://github.com/SkriptDev/HySkript/tree/master/src/test/README.md) for more information.

0 commit comments

Comments
 (0)