Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/styles/Microsoft/Auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ action:
- simple
tokens:
- 'auto-\w+'
# "Auto-configure"/"Auto-configuration" is Codacy's own hyphenated feature and
# button name, verified against the shipped product UI — not a style choice
# this rule should flag.
exceptions:
- Auto-configure
- Auto-configuring
- Auto-configuration
- auto-configure
- auto-configuring
- auto-configuration
12 changes: 12 additions & 0 deletions docs/codacy-ai/codacy-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,15 @@
- To enrich the review, the git diff of the Pull Request as well as some related files' contents can be sent as context. No data is stored on our side, or used to train any models.
- Prompts are neither stored nor visible to anyone.
- As an extra precaution, before any code snippet is sent to the AI model, Codacy automatically redacts secrets (API keys, tokens, credentials, and other high-entropy strings) from the code context.

### Auto-configure repository {: id="auto-configure-repository"}

_This feature uses an AI coding agent, and is strictly opt-in: it only runs when someone with permission to configure code patterns starts it for a specific repository._

Check warning on line 132 in docs/codacy-ai/codacy-ai.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Adverbs] Consider removing 'strictly'. Raw Output: {"message": "[Microsoft.Adverbs] Consider removing 'strictly'.", "location": {"path": "docs/codacy-ai/codacy-ai.md", "range": {"start": {"line": 132, "column": 47}}}, "severity": "WARNING"}

Auto-configure reviews the repository, then applies the same kind of tool and code pattern settings you could otherwise set by hand or through a [Codacy configuration file](../repositories-configure/codacy-configuration-file.md). It also recommends paths to exclude from analysis, which you review and apply yourself.

More details about [Auto-configure repository here](../repositories-configure/configuring-code-patterns.md#auto-configuring-your-repository).

**Notes**

- Codacy does not use your code, repository contents, or comments to train external AI models. No customer code is incorporated into model training.

Check failure on line 140 in docs/codacy-ai/codacy-ai.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Contractions] Use 'doesn't' instead of 'does not'. Raw Output: {"message": "[Microsoft.Contractions] Use 'doesn't' instead of 'does not'.", "location": {"path": "docs/codacy-ai/codacy-ai.md", "range": {"start": {"line": 140, "column": 10}}}, "severity": "ERROR"}
48 changes: 48 additions & 0 deletions docs/repositories-configure/configuring-code-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
By default, Codacy analyzes your repositories using a subset of the supported analysis tools and code patterns. These defaults are based on current best practices and community feedback, and you can adapt them to your needs as follows:

- [Configuring tools and code patterns using the Codacy UI](#configuring-tools-and-code-patterns-using-the-codacy-ui)
- [Auto-configuring your repository](#auto-configuring-your-repository)
- [Discover code patterns across all tools](#discover-code-patterns-across-all-tools)
- [Customizing applied coding standards](#using-your-own-tool-configuration-files)
- [Customizing patterns when following coding standards](#customizing-patterns-following-standards)
Expand Down Expand Up @@ -39,6 +40,53 @@

1. Optionally, to take the changes into account immediately, [reanalyze the repository manually](../faq/repositories/how-do-i-reanalyze-my-repository.md). Otherwise, Codacy will use the updated configuration when analyzing new commits and pull requests.

## Auto-configuring your repository {: id="auto-configuring-your-repository"}

Instead of configuring tools and code patterns by hand, you can have an AI agent review your repository and apply the settings for you. The agent applies the same kind of tool and code pattern settings described above — the same settings you could otherwise set through the Codacy UI or a [Codacy configuration file](codacy-configuration-file.md). It also recommends [paths to exclude](ignoring-files.md) from analysis, which you review and apply yourself. Auto-configure does not change patterns that come from a [coding standard](../organizations/using-coding-standards.md).
Comment thread
LipeGheno marked this conversation as resolved.
Comment thread
LipeGheno marked this conversation as resolved.

There are two ways to run it.

### Running it from Codacy {: id="running-it-from-codacy"}

{%
include-markdown "../assets/includes/paid.md"
start="<!--paid-feature-start-->"
end="<!--paid-feature-end-->"
%}

1. On your repository's **Code patterns** page, select **Auto-configure**.

![The Code patterns page, with the repository's issue count and the Auto-configure button](images/auto-configure-code-patterns.png)

![The Auto-configure button on the Code patterns page](images/auto-configure-button.png)

1. In the dialog, on the **Run here** tab, select **Run auto-configure**.
1. Follow the run's status (queued, running, successful, or failed) on this page.
1. Once the run finishes, the same button reads **Review auto-configuration** — select it to see a summary of what changed, including any recommended paths to exclude.

Check failure on line 65 in docs/repositories-configure/configuring-code-patterns.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Dashes] Remove the spaces around ' — '. Raw Output: {"message": "[Microsoft.Dashes] Remove the spaces around ' — '.", "location": {"path": "docs/repositories-configure/configuring-code-patterns.md", "range": {"start": {"line": 65, "column": 79}}}, "severity": "ERROR"}

**Notes**

- You can start at most one run per repository per day.
- A run takes several minutes. You can leave this page — the results appear here when the run finishes.

Check failure on line 70 in docs/repositories-configure/configuring-code-patterns.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Dashes] Remove the spaces around ' — '. Raw Output: {"message": "[Microsoft.Dashes] Remove the spaces around ' — '.", "location": {"path": "docs/repositories-configure/configuring-code-patterns.md", "range": {"start": {"line": 70, "column": 57}}}, "severity": "ERROR"}
- Your repository's metrics and issue counts may fluctuate while a run is in progress.
Comment thread
LipeGheno marked this conversation as resolved.
- Codacy limits how many runs happen at the same time, both for the organization and across Codacy, so runs stay fast for everyone. If you start a run while one is already queued or running for the same repository, Codacy queues it instead of starting it immediately.
- Each run has a fixed amount of time and AI usage it can use, so a run always finishes or fails instead of continuing indefinitely.
- You can start a new run at any time; it replaces the configuration from the previous run.
Comment thread
LipeGheno marked this conversation as resolved.
- The agent only has access to the repository's code during that one run. It's immediately discarded when the run ends.

### Running it with Codacy Skills {: id="running-it-with-codacy-skills"}

If you'd rather run auto-configuration locally with your own AI agent, use the `configure-codacy` [skill](../codacy-cloud-cli/index.md#install-the-codacy-skills) instead. This option is open-source and isn't limited to paid plans.

1. [Install the Codacy Skills](../codacy-cloud-cli/index.md#install-the-codacy-skills).
1. Open a terminal in your repository's root directory and run the skill:

```bash
claude /configure-codacy
```

The configuration process may take a while.
Comment thread
LipeGheno marked this conversation as resolved.

## Discover code patterns across all tools {: id="discover-code-patterns-across-all-tools"}

To discover code patterns across all tools, click **Discover patterns** at the top of the **Tools** list.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
LipeGheno marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading