Skip to content

Commit 9614c05

Browse files
committed
Align contributing guide and code style
1 parent 1168adb commit 9614c05

6 files changed

Lines changed: 59 additions & 54 deletions

File tree

‎.idea/codeStyles/Plexus_Code_Style.xml‎

Lines changed: 3 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/codeStyles/codeStyleConfig.xml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎CONTRIBUTING.md‎

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
1-
For those who are wanting to contribute, we fully encourage doing so. There are a few rules we require following when contributing however.
1+
# Contributing
2+
3+
Contributions are welcome. Follow these rules when you contribute.
24

35
## Steps
4-
1. Make an issue and get feedback. It's important to know if your idea will be accepted before writing any code.
5-
- If it is a feature request, describe the feature and be extremely specific.
6-
- If it is a bug report, ensure you include how to reproduce the bug and the expected outcome
7-
- If it is an enhancement, describe your proposed changes. Ensure you are extremely specific.
8-
2. Fork this project
9-
3. Create a new branch that describes the new feature, enhancement, or bug fix. For example, this is good: `feature/add-xyz`. This is bad: `fix-this-lol`.
10-
4. Write the code that addresses your change.
11-
- Keep in mind that it **must** be formatted correctly. If you are using IntelliJ, there is a `codeStyle.xml` file that tells IntelliJ how to format your code. Check this link for information on how to use the file: https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes
12-
- If you are not using IntelliJ, that is fine. We use the Plexus Code Style (which is almost the same as Allman) so please format your code accordingly.
13-
6. Push your changes to your new branch and make a PR based off of that branch.
14-
15-
## Requirements for a PR
16-
- The issue must be marked as approved
17-
- It must only address each specific issue. Don't make one PR for multiple issues.
18-
- Your PR must compile and work. If it does not compile or work, your PR will most likely be rejected.
6+
7+
1. Open an issue and wait for feedback. This tells you if the change will be accepted before you write any code.
8+
- For a feature request, describe the feature in detail.
9+
- For a bug report, give the steps to reproduce the bug and the result that you expected.
10+
- For an enhancement, describe the change that you propose in detail.
11+
2. Fork this repository.
12+
3. Create a branch with a name that describes the change. For example, `feature/add-xyz` is good. `fix-this-lol` is
13+
bad.
14+
4. Write the code for your change.
15+
- In IntelliJ IDEA, the project includes the Plexus Code Style in `.idea/codeStyles`. IntelliJ uses it
16+
automatically.
17+
- In other editors, follow the Plexus Code Style. It is close to the Allman style: put each opening brace on its own
18+
line.
19+
5. Run `./gradlew build` (on Windows, `gradlew.bat build`). The build must pass, including Checkstyle.
20+
6. Push your branch and open a pull request from it.
21+
22+
## Pull request requirements
23+
24+
- The issue must be approved.
25+
- Each pull request addresses one issue only.
26+
- Your code must compile and work. If it does not, we will most likely reject the pull request.
1927

2028
## Code requirements
21-
- Most importantly, your code must be efficient. Your pull request may be rejected if your code is deemed inefficient or sloppy.
22-
- Do not repeat yourself. Create functions as needed if you're using large blocks of code over and over again.
23-
- Do not use an excessive amount of commits when making your PR. It makes the master branch look messy.
24-
- Your code must be consistent with Plex's codebase. If a function already exists, use it.
29+
30+
- Your code must be efficient. We can reject a pull request if the code is inefficient or sloppy.
31+
- Do not repeat code. If you use a large block of code more than once, move it into a method.
32+
- Do not add many small commits to your pull request. They make the project history hard to read.
33+
- Follow the existing code. If a method already does what you need, use it.
34+
35+
## Documentation
36+
37+
Read the documentation at [plex.us.org](https://plex.us.org) for setup, configuration, and module development.

‎build.gradle.kts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
java
3+
checkstyle
34
`maven-publish`
45
}
56

@@ -30,6 +31,11 @@ java {
3031
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
3132
}
3233

34+
checkstyle {
35+
toolVersion = "14.3.0"
36+
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
37+
}
38+
3339
publishing {
3440
publications {
3541
create<MavenPublication>("maven") {

‎config/checkstyle/checkstyle.xml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
<module name="SuppressWarningsFilter"/>
8+
<module name="TreeWalker">
9+
<module name="SuppressWarningsHolder"/>
10+
<module name="CyclomaticComplexity">
11+
<property name="max" value="15"/>
12+
<property name="switchBlockAsSingleDecisionPoint" value="true"/>
13+
</module>
14+
</module>
15+
</module>

‎src/main/resources/module.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Module-Example
22
main: dev.plex.ExampleModule
3-
description: An example module for Plex
3+
description: A starting point for your own Plex module
44
version: 2.0.1-SNAPSHOT
55
apiCompatibility: 1
66
updater:

0 commit comments

Comments
 (0)