From 41aac9a54e4286c2171e6dfa1808f5f1e8eb836b Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 28 May 2024 21:20:51 +0200 Subject: [PATCH] docs: add intellij code style --- .github/CONTRIBUTING.md | 17 ++------- config/intellij-code-style.xml | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 config/intellij-code-style.xml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 377f73eab..86611e2dd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -13,7 +13,7 @@ These are the most important things to know before contributing (also explained Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). - We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is - recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your + recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your IDE, so that formatting rules are respected. - Branches are kept up to date by rebasing, not by merging. - For non-technical changes, adding a changelog entry is required. @@ -98,25 +98,12 @@ from [API Guardian](https://github.com/apiguardian-team/apiguardian). We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. -It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) file into your +It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your IDE, so that formatting rules are respected. Moreover, the [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) can be used to check if there are no style violations. -### Import order - -IntellIJ does not import the `import` order rules correctly. Apply following order manually: - -- import `com.refinedmods.*` -- blank line -- import `java.*` -- import `javax.*` -- blank line -- import all other imports -- blank line -- import static all other imports - ## Architecture ### Architecture Decision Records diff --git a/config/intellij-code-style.xml b/config/intellij-code-style.xml new file mode 100644 index 000000000..9a82b0fd0 --- /dev/null +++ b/config/intellij-code-style.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file