Quick-fix
Quick-fix lets you improve development performance through fixing codebase problems automatically.
This feature is available starting from version 2023.2 of Qodana and supported by the following linters and their trial versions:
You can choose between several quick-fix strategies mentioned in this table.
Quick-fix strategy | Description |
---|---|
| The default strategy that requires no configuration and implies that no quick-fixes are applied to your project |
| Automatic application of the minor and safe cleanup inspections that do not affect the project logic and behavior |
| Qodana attempts to evaluate and fix all problems detected in the codebase. This approach may lead to serious code modifications that can affect the project logic and behavior. These changes should be reviewed before submitting |
You can apply quick-fix strategies using the following available options:
Depending on the quick-fix strategy, run Qodana using either the --apply-fixes
or the --cleanup
option. The QODANA_TOKEN
variable refers to the project token required by the Ultimate and Ultimate Plus linters.
$docker run \ -v <source-directory>/:/data/project/ \ -e QODANA_TOKEN="<cloud-project-token>" \ jetbrains/qodana-<linter> \ <--apply-fixes/--cleanup>
$qodana scan \ -e QODANA_TOKEN="<cloud-project-token>" \ <--apply-fixes/--cleanup>
You can use the fixesStrategy
option in the qodana.yaml
file:
fixesStrategy: cleanup/apply
Learn the GitHub Actions section for details.
Thanks for your feedback!