From 9c11b22d841b3902a1b3ab77193f768769af556f Mon Sep 17 00:00:00 2001 From: Viktor Date: Fri, 20 Oct 2023 22:44:39 +0200 Subject: [PATCH] :memo: Update README.md --- README.md | 133 ++---------------------------------------------------- 1 file changed, 4 insertions(+), 129 deletions(-) diff --git a/README.md b/README.md index 958ae1e6..bc7f604c 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ duplications, and imperfections. - Qodana Scan - [Usage](#usage) - [Configuration](#configuration) -- [Qodana for Gradle](#qodana-for-gradle) - - [`qodanaScan` task](#qodanascan) - [Issue Tracker](#issue-tracker) @@ -283,124 +281,6 @@ with: | `github-token` | GitHub token to access the repository: post annotations, comments. Optional. | `${{ github.token }}` | | `push-fixes` | Push Qodana fixes to the repository, can be `none`, `branch` to the current branch, or `pull-request`. Optional. | `none` | -[gh:qodana]: https://github.com/JetBrains/qodana-action/actions/workflows/code_scanning.yml -[youtrack]: https://youtrack.jetbrains.com/issues/QD -[youtrack-new-issue]: https://youtrack.jetbrains.com/newIssue?project=QD&c=Platform%20GitHub%20action -[jb:confluence-on-gh]: https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub -[jb:discussions]: https://jb.gg/qodana-discussions -[jb:twitter]: https://twitter.com/Qodana -[jb:docker]: https://hub.docker.com/r/jetbrains/qodana - -# Qodana for Gradle - -[![official JetBrains project](https://jb.gg/badges/official.svg)][jb:confluence-on-gh] -[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/org.jetbrains.qodana?color=green&label=Gradle%20Plugin%20Portal&logo=gradle)][gradle-plugin-page] -[![Build](https://github.com/JetBrains/gradle-grammar-kit-plugin/workflows/Build/badge.svg)][gh:build] -[![GitHub Discussions](https://img.shields.io/github/discussions/jetbrains/qodana)][jb:discussions] -[![Twitter Follow](https://img.shields.io/badge/follow-%40Qodana-1DA1F2?logo=twitter)][jb:twitter] - -Gradle interface to run [Qodana](https://jetbrains.com/qodana) - -> **Important:** -> This project requires Gradle 6.6 or newer; however, it is recommended to use the [latest Gradle available](https://gradle.org/releases/). Update it with: -> ```bash -> ./gradlew wrapper --gradle-version=VERSION -> ``` - -## Gradle Configuration - -> **Note:** Make sure you have `docker` installed and available in your environment if you want to run Qodana in a container. - -Apply Gradle plugin `org.jetbrains.qodana` in the Gradle configuration file: - -- Groovy – `build.gradle` - - ```groovy - plugins { - id "org.jetbrains.qodana" version "..." - } - ``` - -- Kotlin DSL – `build.gradle.kts` - - ```kotlin - plugins { - id("org.jetbrains.qodana") version "..." - } - ``` - -> **Note:** The latest version is: [![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/org.jetbrains.qodana?color=green&label=Gradle%20Plugin%20Portal&logo=gradle)][gradle-plugin-page] - -### `qodana { }` extension configuration -Properties available for configuration in the `qodana { }` top-level configuration closure: - -| Name | Description | Type | Default Value | -|------------------|------------------------------------------------------|-----------|-----------------------------------------| -| `projectPath` | Path to the project folder to inspect. | `String` | `project.projectDir` | -| `resultsPath` | Path to the directory to store task results. | `String` | `"${projectPath}/build/qodana/results"` | -| `cachePath` | Path to the directory to store the generated report. | `String` | `"${projectPath}/build/qodana/cache/"` | - -## Gradle Qodana Tasks - -### `qodanaScan` - -Start Qodana in the project directory. - -The task relies on the `qodana { }` extension configuration. However, it is also controlled by provided `arguments`. - - -### Example - -Add this to your Gradle configuration file: - -- Groovy – `build.gradle` - - ```groovy - plugins { - // applies Gradle Qodana plugin to use it in project - id "org.jetbrains.qodana" version "..." - } - - qodana { - // by default result path is $projectPath/build/results - resultsPath = "some/output/path" - } - - qodanaScan { - arguments = ["--fail-threshold", "0"] - } - ``` - -- Kotlin – `build.gradle.kts` - - ```kotlin - plugins { - // applies Gradle Qodana plugin to use it in project - id("org.jetbrains.qodana") version "..." - } - - qodana { - // by default result path is $projectPath/build/results - resultsPath.set("some/output/path") - } - - qodanaScan { - resultsPath.set("some/output/path") - arguments.set(listOf("--fail-threshold", "0")) - } - ``` - -> **Note:** Docker requires at least 4GB of memory. Set it in the Docker `Preferences > Resources > Memory` section. - -Now you can run inspections with `qodanaScan` Gradle task: - -```bash -gradle qodanaScan -// or -./gradlew qodanaScan -``` - -A complete guide for options and configuration of `arguments` parameters can be found on [Qodana CLI docs page]((https://github.com/JetBrains/qodana-cli#scan)). ## Issue Tracker @@ -408,15 +288,10 @@ All the issues, feature requests, and support related to Qodana are handled on [ If you'd like to file a new issue, please use the link [YouTrack | New Issue][youtrack-new-issue]. -[gh:build]: https://github.com/JetBrains/gradle-qodana-plugin/actions?query=workflow%3ABuild -[gradle-plugin-page]: https://plugins.gradle.org/plugin/org.jetbrains.qodana +[gh:qodana]: https://github.com/JetBrains/qodana-action/actions/workflows/code_scanning.yml +[youtrack]: https://youtrack.jetbrains.com/issues/QD +[youtrack-new-issue]: https://youtrack.jetbrains.com/newIssue?project=QD&c=Platform%20GitHub%20action [jb:confluence-on-gh]: https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub [jb:discussions]: https://jb.gg/qodana-discussions [jb:twitter]: https://twitter.com/Qodana -[youtrack]: https://youtrack.jetbrains.com/issues/QD -[youtrack-new-issue]: https://youtrack.jetbrains.com/newIssue?project=QD&c=Platform%20Gradle%20Plugin&c=Tool%20IntelliJ%20(Code%20Inspection) -[youtrack]: https://youtrack.jetbrains.com/issues/QD -[youtrack-new-issue]: https://youtrack.jetbrains.com/newIssue?project=QD&c=Platform%20Gradle%20Plugin&c=Tool%20IntelliJ%20(Code%20Inspection) - - - +[jb:docker]: https://hub.docker.com/r/jetbrains/qodana