diff --git a/.github/styles/config/vocabularies/Codacy/accept.txt b/.github/styles/config/vocabularies/Codacy/accept.txt index 5fe1ef1f69..6368c90471 100644 --- a/.github/styles/config/vocabularies/Codacy/accept.txt +++ b/.github/styles/config/vocabularies/Codacy/accept.txt @@ -1,10 +1,10 @@ aligncheck -autofix -autoremediate allowlist +Ameba Atlassian +autofix +autoremediate autovacuum -Ameba Bandit Bitbucket Bitnami @@ -13,8 +13,8 @@ bundler-audit Checkov Checkstyle Clang-Tidy -CloudFormation cloc +CloudFormation Cobertura Codacy CodeNarc @@ -51,6 +51,7 @@ jq jscpd JSHint JSP +Junie markdownlint monorepo namespace @@ -60,8 +61,8 @@ PHP_CodeSniffer PHPUnit plaintext PMD -Prospector Promtail +Prospector PSScriptAnalyser PVC Pylint @@ -86,8 +87,8 @@ Staticcheck Stylelint SwiftLint Tailor -Trivy tooltip +Trivy TSLint TSQLLint unassigns @@ -95,5 +96,5 @@ unfollow vacuumdb Visualforce VSCode -Xcode webserver +Xcode diff --git a/docs/codacy-guardrails/codacy-guardrails-getting-started.md b/docs/codacy-guardrails/codacy-guardrails-getting-started.md index ff82b2f704..b30a3f8107 100644 --- a/docs/codacy-guardrails/codacy-guardrails-getting-started.md +++ b/docs/codacy-guardrails/codacy-guardrails-getting-started.md @@ -9,6 +9,8 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co +# VSCode-based IDEs + ## Prerequisites - git @@ -23,6 +25,7 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co !!! important **For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. + We currently only support VSCode, Cursor, and Windsurf on Windows. ### Supported IDEs @@ -48,13 +51,14 @@ Besides real-time AI code scanning, Guardrails users can now prompt all their Co ## How to install - Quick Guide {: id="how-to-install-quick-guide"} #### Note for Windows users: -To take full advantage of Codacy Guardrails on Windows, you might need to setup WSL first, [check the steps here.](#how-to-install-wsl) +To take advantage of Codacy Guardrails on Windows, you might need to setup WSL first, [check the steps here.](#how-to-install-wsl) ### 1. Download the extension -- [Visual Studio Code](https://tinyurl.com/codacy-vscode) +- [Visual Studio Code](https://tinyurl.com/codacy-vscode-extension) - [Cursor](http://tinyurl.com/codacy-cursor) - [Windsurf](http://tinyurl.com/codacy-windsurf) +- [IntelliJ IDEA](https://tinyurl.com/codacy-jetbrains-extension) This will open the Codacy Extension in your IDE Marketplace. Click **Install** @@ -219,4 +223,115 @@ b. Make sure you have Agent mode enabled: [vscode://settings/chat.agent.enabled] c. Open the Copilot chat and switch the mode to `Agent`. You can check that the MCP server was enabled correctly by clicking on the `Select tools` icon, which should list all the available Codacy tools. -![Copilot Agent with Codacy tools](images/copilot_agent.png) \ No newline at end of file +![Copilot Agent with Codacy tools](images/copilot_agent.png) + + +# JetBrains IDEs + + +### Supported Operating Systems + +- macOS +- Linux +- Windows (via WSL) + +!!! important + **For Windows users: Windows WSL** (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. **Only local analysis** are supported for Windows, as MCP support for JetBrains IDEs is still not completely done. + + +### Supported IDEs + +- IntelliJ IDEA +- PyCharm +- PhpStorm +- Others in the suite + +!!! note + For JetBrains IDEs, IntelliJ isn't the only supported editor, but is our primary focus. If you use other editors such as PyCharm and run into any issues, feel free to open an issue in our extension's [repository](https://github.com/codacy/codacy-intellij-extension). Check the [extension page](https://tinyurl.com/codacy-jetbrains-extension) on the marketplace to see the full list of supported IDEs. + +### Built-in Scanners + +- Trivy +- Semgrep +- ESLint +- Pylint +- PMD +- dartanalyzer +- [Lizard](https://docs.codacy.com/release-notes/cloud/cloud-2025-02-adding-ruff-lizard/#lizard) +- Revive + +## How to install - JetBrains Quick Guide {: id="how-to-install-quick-guide-jetbrains"} + +#### Note for Windows users: +To take advantage of Codacy Guardrails on Windows, you need to set up WSL first; [check the steps here](#how-to-install-wsl). **Only local analysis** are supported for Windows, as MCP support for JetBrains IDEs is still not completely done. + +### 1. Install the extension + + +You can either install the dependency from the [JetBrains marketplace](https://tinyurl.com/codacy-jetbrains-extension) or search for it directly in your Codacy plugin's settings. + +!!! note + If you don’t see the Codacy plugin icon on the left taskbar after installing it, go to View > Tool Windows > Codacy + +![Install Extension](images/install-codacy-extension-jetbrains.png) + + +### 2. Install and activate the Codacy CLI for local analysis + +Click on the Codacy button on the lower right part of your IDE, and click **Install CLI** + +![Install CLI](images/codacy-extension-activate-cli-jetbrains.png) + +It will create a folder in your local repository called **.codacy** with all needed configuration: + +- The configuration from all built-in scanners +- Codacy CLI script to run analysis locally + +!!! note + If you don't want this folder to be part of your repository in future commits but continue working with it locally, please add **.codacy** to your .gitignore file + +!!! note + The IDE extension will ignore any CLI version already installed (for example, through brew or other package manager) on the machine. + + +### 3. Install MCP Server + +#### a. Add the Codacy MCP Server + +After clicking on the Codacy icon on the lower right of the editor, click on **Install AiAgent MCP** + +![Add Codacy MCP Server](images/codacy-extension-activate-cli-jetbrains.png) + +#### b. Check if the Codacy MCP Server is enabled + +In your IntelliJ settings, search the settings for the agent of your choice (Junie or Copilot) and confirm that Codacy is listed on the MCP settings tab. + +![Codacy MCP Server is enabled](images/mcp-settings-extension-jetbrains.png) + +!!! note + You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP. + +#### c. Confirm the settings of your Codacy extension + +In your IntelliJ settings, search the settings for the Codacy extension and confirm that you're using the correct version of the CLI, as well as your preferred AI agent. + +If you want Codacy to generate the AI agent guidelines (which will instruct the agent to run the Codacy local analysis on changes, for example) for you, you should also enable this option in the editor settings. + +![Codacy MCP Server is enabled](images/extension-settings-jetbrains.png) + +#### d. Generate AI guidelines +Install the guidelines by clicking on **Install AiAgent Guidelines** on the Codacy icon on the lower right part of your IDE. + +![Install Agent Guidelines](images/codacy-extension-activate-cli-jetbrains.png) + +!!! note + You need to install the plugin for your desired agent. Make sure to install JetBrains Junie or GitHub Copilot if you want to integrate the Codacy MCP. + +### 4. Restart your IDE to apply changes + +### 5. After everything is set up, you should now be able to interact with Codacy via AI chat. +* Remember that for you to be able to interact with the Codacy MCP server, you must be on the `Agent` mode of the chat (`Code` on Junie), not `Ask` nor `Edit` mode. + +### 6. Start using your Agent and Codacy will be there with you! + +![Codacy Guardrails running in JetBrains](images/codacy-guardrails-junie.png) \ No newline at end of file diff --git a/docs/codacy-guardrails/codacy-guardrails-limitations.md b/docs/codacy-guardrails/codacy-guardrails-limitations.md index 9f40970f11..7226614408 100644 --- a/docs/codacy-guardrails/codacy-guardrails-limitations.md +++ b/docs/codacy-guardrails/codacy-guardrails-limitations.md @@ -2,4 +2,4 @@ ## Limitations with Windows -Windows WSL (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. \ No newline at end of file +Windows WSL (a feature that allows you to run a Linux environment directly on Windows, without the need for a virtual machine or dual-boot setup) is the only way you can use this feature for now, but we're still working to fully support Windows. Additionally, at this point we're only supporting VSCode and VSCode-based IDEs on Windows. \ No newline at end of file diff --git a/docs/codacy-guardrails/images/codacy-extension-activate-cli-jetbrains.png b/docs/codacy-guardrails/images/codacy-extension-activate-cli-jetbrains.png new file mode 100644 index 0000000000..9cabd462e5 Binary files /dev/null and b/docs/codacy-guardrails/images/codacy-extension-activate-cli-jetbrains.png differ diff --git a/docs/codacy-guardrails/images/codacy-guardrails-junie.png b/docs/codacy-guardrails/images/codacy-guardrails-junie.png new file mode 100644 index 0000000000..689f4f8576 Binary files /dev/null and b/docs/codacy-guardrails/images/codacy-guardrails-junie.png differ diff --git a/docs/codacy-guardrails/images/extension-settings-jetbrains.png b/docs/codacy-guardrails/images/extension-settings-jetbrains.png new file mode 100644 index 0000000000..e05e90f7ff Binary files /dev/null and b/docs/codacy-guardrails/images/extension-settings-jetbrains.png differ diff --git a/docs/codacy-guardrails/images/install-codacy-extension-jetbrains.png b/docs/codacy-guardrails/images/install-codacy-extension-jetbrains.png new file mode 100644 index 0000000000..b83f47318f Binary files /dev/null and b/docs/codacy-guardrails/images/install-codacy-extension-jetbrains.png differ diff --git a/docs/codacy-guardrails/images/mcp-settings-extension-jetbrains.png b/docs/codacy-guardrails/images/mcp-settings-extension-jetbrains.png new file mode 100644 index 0000000000..e1dc9a9a60 Binary files /dev/null and b/docs/codacy-guardrails/images/mcp-settings-extension-jetbrains.png differ diff --git a/docs/getting-started/integrating-codacy-with-intellij-ides.md b/docs/getting-started/integrating-codacy-with-intellij-ides.md index 8eaf8a9248..25e8555dcc 100644 --- a/docs/getting-started/integrating-codacy-with-intellij-ides.md +++ b/docs/getting-started/integrating-codacy-with-intellij-ides.md @@ -81,6 +81,9 @@ To review issues: When the analysis is complete, the Codacy plugin automatically refreshes the pull request analysis result. You can also refresh the pull request data manually by clicking the Refresh Pull Request button in the main view. +## Running Codacy Guardrails +As of version [0.0.8](https://plugins.jetbrains.com/plugin/23924-codacy/versions/stable/840439), the IntelliJ plugin now supports Codacy Guardrails. To see how to get it quickly setup refer to our quickstart guide [here](../codacy-guardrails/codacy-guardrails-getting-started.md#how-to-install-quick-guide-jetbrains). + ## See also - [Troubleshooting the Codacy IntelliJ plugin](https://github.com/codacy/codacy-intellij-extension?tab=readme-ov-file#troubleshooting)