Skip to content

Commit

Permalink
Re-add "Have auto format working properly in JavaDoc" (and re-order s…
Browse files Browse the repository at this point in the history
…ections)
  • Loading branch information
koppor committed Oct 5, 2024
1 parent e8289fb commit 6170181
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@ Also, set the "Scan Scope" to "Only Java sources (including tests)".

Save settings by clicking "Apply" and then "OK"

## Run checkstyle

In the lower part of IntelliJ's window, click on "Checkstyle".
In "Rules", change to "JabRef".
Then, you can run a check on all modified files.

{% figure caption:"JabRef's style is active - and we are ready to run a check on all modified files" %}
![JabRef's style is active - and we are ready to run a check on all modified files](guidelines-intellij-checkstyle-window.png)
{% endfigure %}

## Enable proper import cleanup

To enable "magic" creation and auto cleanup of imports, go to **File > Settings... > Editor > General > Auto Import**.
Expand All @@ -141,6 +131,18 @@ There, enable both "Add unambiguous imports on the fly" and "Optimize imports on

Press "OK".

## Have auto format working properly in JavaDoc

To have auto format working properly in the context of JavaDoc and line wrapping, "Wrap at right margin" has to be disabled. Details are found in [IntelliJ issue 240517](https://youtrack.jetbrains.com/issue/IDEA-240517).

Go to **File > Settings... > Editor > Code Style > Java > JavaDoc**.

At "Other", disable "Wrap at right margin"

{% figure caption:"”Wrap at right margin” disabled" %}
!["Wrap at right margin" disabled](guidelines-intellij-editor-javadoc-do-not-wrap.png)
{% endfigure %}

## Disable too advanced code folding

Go to **File > Settings... > Editor > General > Code Folding**.
Expand All @@ -153,6 +155,16 @@ At section "Java", disable "One-line methods".

Press "OK".

## Run checkstyle

In the lower part of IntelliJ's window, click on "Checkstyle".
In "Rules", change to "JabRef".
Then, you can run a check on all modified files.

{% figure caption:"JabRef's style is active - and we are ready to run a check on all modified files" %}
![JabRef's style is active - and we are ready to run a check on all modified files](guidelines-intellij-checkstyle-window.png)
{% endfigure %}

## Final comments

{: .highlight }
Expand Down

0 comments on commit 6170181

Please sign in to comment.