From 2a213a778850f748381af207c060b34452b0bc4b Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 27 Dec 2020 18:30:41 +0000 Subject: [PATCH] Created CONTRIBUTING.md and updated checkstyle.xml --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ config/checkstyle/checkstyle.xml | 6 ++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..0fa3d1ff --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# How to contribute to EcoEnchants + +## Codestyle +1. The EcoEnchants checkstyle is in /config/checkstyle.xml +- The pull request must not have any checkstyle issues. +- Every method and field must have a javadoc attached. + +2. Use sonarlint (base config) if possible. + +3. Use lombok wherever possible. +- As of 6.0.0, EcoEnchants is now built with lombok. +- @Getter, @Setter, @ToString, @EqualsAndHashCode, @UtilityClass are the most important. + +4. Use JetBrains annotations +- Every parameter should be annotated with @NotNull or @Nullable +- Use @NotNull over lombok @NonNull + +5. Imports +- No group (*) imports. +- No static imports. + +## Dependency Injection +- EcoEnchants uses Dependency Injection since 6.0.0. +- Any calls to AbstractEcoPlugin#getInstance are code smells and should never be used unless **absolutely necessary**. +- NamespacedKeys, FixedMetadataValues, Runnables, and Schedules should be managed using EcoEnchantsPlugin through DI. +- Any DI class should extend PluginDependent where possible. If the class extends another, then you **must** store the plugin instance in a private final variable called **plugin** with a private or protected getter. + +## Other +- All drops **must** be sent through a DropQueue - calls to World#dropItem will get your PR rejected. +- EcoEnchants is built with java 8. Usage of J9+ will get your PR rejected. +- Any non-plugin-specific changes **must** be made to eco-util, or core-proxy, rather than core-plugin. \ No newline at end of file diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index b8bcc3d2..fb099ea1 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -87,16 +87,14 @@ - + - -->