Qodana 2024.1 Help

Configure Qodana your way

Qodana inspection profiles configure the inspections that you are going to use. If you enable too few inspections, you may miss critical problems, which will affect your project overall. On the other hand, enabling too many inspections can negatively affect inspection performance and can result in using inspections that are irrelevant to your project.

Qodana provides the default qodana.starter and qodana.recommended profiles that come in handy in most cases. You can override a default profile according to your needs, and this section provides basic recommendations taken from the Custom YAML profiles section.

Initial configuration

  1. In your project root, create the YAML-formatted file. Save the following configuration, which will contain the name and baseProfile blocks for naming your Qodana profile and overriding the qodana.recommended profile:

    name: "Configuring Qodana" # Paste the name of your profile baseProfile: qodana.recommended # Override qodana.recommended
  2. In the qodana.yaml file, provide the path to the file configured in the previous step:

    profile: path: <relative-path-to-yaml-config-file>

Enable JavaScript and TypeScript inspections

Starting from version 2023.2 of Qodana, all linters provide JavaScript and TypeScript inspections, but they are disabled by default. You can enable the JavaScript and TypeScript inspection category using the inspections block, so the configuration will look as follows:

name: "Configuring Qodana" baseProfile: qodana.recommended inspections: - group: "category:JavaScript and TypeScript" # Specify the inspection category enabled: true # Enable the JavaScript and TypeScript category

Exclude a specific inspection

Suppose, before running the Qodana for PHP linter, you would like to exclude the PhpDeprecationInspection inspection supported by the qodana.recommended profile. In this case, you can update your configuration as follows:

name: "Configuring Qodana" baseProfile: qodana.recommended inspections: - group: "category:JavaScript and TypeScript" enabled: true - inspection: PhpDeprecationInspection # Specify an inspection enabled: false # Disable the inspection

Specify inspection path(s)

You can tell Qodana to ignore specific paths while inspecting your code. Suppose you would like to ignore the vendor directory in your project root. You can do this by using the ignore block. The final configuration would look like this:

name: "Configuring Qodana" baseProfile: qodana.recommended inspections: - group: "category:JavaScript and TypeScript" enabled: true ignore: - "vendor/**" # Ignore the vendor directory - inspection: PhpDeprecationInspection enabled: false

Learn more

You can visit the Custom YAML profiles section to learn more about advanced configuration techniques, more configuration examples, and creating configurations from scratch.

Once you have configured Qodana, you can run it using the recommendations from the Quick start section.

Last modified: 03 May 2024