Qodana 2024.3 Help

Inspect code formatting

You can use Qodana to analyze whether your code adheres to correct formatting. Currently, Qodana can analyze the IntelliJ IDEA, Eclipse, and EditorConfig code style schemes.

Follow these steps to configure formatting analysis.

  1. In your IDE, configure the project code style scheme that you would like to employ, see the IntelliJ IDEA documentation as an example.

  2. In the .idea/codeStyles directory of your project, save the codeStyleConfig.xml file containing the following configuration:

    <component name="ProjectCodeStyleConfiguration"> <state> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> </state> </component>
  3. In the qodana.yaml file, enable the IncorrectFormatting inspection:

    include: - name: IncorrectFormatting

Once all configurations are complete, you can run Qodana.

Last modified: 20 September 2024