Skip to content

Configuring custom SDK checkstyle with IntelliJ

Sameeksha Vaity edited this page Jan 5, 2021 · 8 revisions

This Checkstyle Plugin enables on-demand scanning of Java files so that they conform to our CheckStyle rules, from within IntelliJ IDEA.

Steps:

  1. Make sure you’ve got Checkstyle-IDEA plugin (8.36 version). If not, install via  File → Settings… → Plugins → Browse Repositories.

  2. Open File > Settings > Tools > CheckStyle

    2.1. Click "+" to add a new custom checkstyle configuration file.

    2.2. Add a description for the checkstyle configuration.

    2.3. Click "Browse" and add the checkstyle configuration file in your local folder under eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml

    2.4. Click Next

  3. Add checkstyle suppression file path.

    Since the suppression file is in the same local directory enter "/".

  4. Click "Next", you should get the following dialog. Click "Finish" to complete this setup.

  5. To add the third party checks jar. Compile the latest sdk-build-tools-1.0.0.jar from here.

    mvn clean install -f C:\~\Java\azure-sdk-for-java\eng\code-quality-reports\pom.xml

  6. This is the final screen of the checkstyle setup. Select the checkbox "sdk-checkstyle" and click Apply.

  7. Verify the checkstyle results. Go to a Java file, Click on "Check Current File" or "Check Module" or "Check Project" to run the custom sdk-checkstyle configuration on your project.

Clone this wiki locally