Skip to content

Checkstyle Configuration in IntelliJ

Etimbuk U edited this page Apr 3, 2020 · 1 revision

Checkstyle IntelliJ Configuration

  • Install Checkstyle plugin in IntelliJ
    • Navigate to Prefences > Plugins dialog
    • Search for and select Checkstyle plugin from Marketplace
    • Click Install
    • Restart IntelliJ
  • Navigate to Prefences dialog
  • Select Editor > Code Style > Java
  • On the right hand side of Scheme, click on the dropdown settings option
  • Select Import Scheme > CheckStyle Configuration
  • From the dialog, select checkstyle.xml configuration file
  • Once selected, this might be name Default Copy, you can rename this to make it more descriptive

Creating PR and validating with CheckStyle

  • Select file(s) you intend to commit
  • Confirm Scan with Checkstyle

CheckStyle - Adding our checkstyle.xml file

  • Navigate to Prefences > Other Settings > CheckStyle dialog
  • Select + icon
  • Navigate to checkstyle.xml file
  • Click Next