-
Notifications
You must be signed in to change notification settings - Fork 31
Working with the Code
See the CONTRIBUTING guide for information on how to contribute issues and code changes to the project.
If you have performed a checkout of this repository already, use “File” → “Open” and then select the project directory to import the code.
The formatter plugin will allow you to format your code from within IDEA.
-
Download the latest IntelliJ IDEA plugin jar.
-
Select “IntelliJ IDEA” → “Preferences”.
-
Select “Plugins”.
-
Select the wheel and “Install Plugin from Disk…”.
-
Select the jar file you’ve downloaded.
-
Restart IntelliJ
It is a good idea to copy the default formatter to a Spring gRPC one.
-
Select “IntelliJ IDEA” → “Preferences”.
-
Select “Editor” → “Code Style”.
-
Notice the “Scheme” is set to
Spring Boot Java Conventions NEW
. -
Select the wheel and “Duplicate” and name it
Spring gRPC
-
Click “Ok”
The formatter does not cover all rules (such as order of imports) and an additional file needs to be added.
-
Select “IntelliJ IDEA” → “Preferences”.
-
Select “Editor” → “Code Style”.
-
Select the wheel and “Import Scheme” → “IntelliJ IDEA code style XML”.
-
Select
idea/codeStyleConfig.xml
from this repository.
While not strictly required, the CheckStyle-IDEA plugin hooks in the formatter rules and your local checkstyles so that any checkstyle related operations in IDEA use the rules you expect.
-
Download the latest CheckStyle-IDEA plugin.
-
Select “IntelliJ IDEA” → “Preferences”.
-
Select “Plugins”.
-
Select the wheel and “Install Plugin from Disk…”.
-
Select the zip file you’ve downloaded.
-
Download the latest spring-javaformat-checkstyle jar
-
Download the latest spring-javaformat-config jar
-
Select “IntelliJ IDEA” → “Preferences” → “Tools” → “Checkstyle”.
-
Specify the appropriate Checkstyle version (currently
9.3
) -
Add the downloaded
spring-javaformat-checkstyle-0.0.43.jar
andspring-javaformat-config-0.0.43.jar
to the “Third-Party Checks” -
Select “+” on “Configuration File” to add configuration file
-
Use Description: "Spring gRPC checkstyle"
-
Select "Use a local checkstyle file" and navigate to "src/checkstyle/checkstyle.xml"
-
Enter "config_loc" of "src/checkstyle" if prompted
-
Select "Next"
-
Important
|
Once all of the above is complete you can view and fix checkstyle violations directly from within IntelliJ. |