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.
In your IDE, configure the project code style scheme that you would like to employ, see the IntelliJ IDEA documentation as an example.
In the
.idea/codeStyles
directory of your project, save thecodeStyleConfig.xml
file containing the following configuration:<component name="ProjectCodeStyleConfiguration"> <state> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> </state> </component>In the
qodana.yaml
file, enable theIncorrectFormatting
inspection:include: - name: IncorrectFormatting
Once all configurations are complete, you can run Qodana.
Last modified: 20 September 2024