Skip to content

Commit

Permalink
Merge branch 'master' into TAROT-2591-p-1-doc-update-docs-security-an…
Browse files Browse the repository at this point in the history
…d-compliance-reporting
  • Loading branch information
nicklem authored Apr 4, 2024
2 parents 30ac9b6 + 0f907fc commit a3baab2
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deleted-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Get changed docs md files
id: changed-files
uses: tj-actions/changed-files@v43
uses: tj-actions/changed-files@v44
with:
files: docs/**/*.md

Expand Down
Binary file modified docs/faq/troubleshooting/images/organization-refresh-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/organizations/images/organization-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/organizations/images/organization-join.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/organizations/what-are-organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This opens the list of organizations on your Git providers. The organization wit
- To add organizations from a Git provider not yet listed on this page, click **Add provider** and give the [necessary permissions](../getting-started/which-permissions-does-codacy-need-from-my-account.md) for Codacy to sync with the new Git provider and display your organizations.

!!! note
If you can't see the organization you're looking for, follow the instructions in the card **Adding new organizations** or [these troubleshooting instructions](../faq/troubleshooting/why-cant-i-see-my-organization.md).
If you can't see the organization you're looking for, [follow these troubleshooting instructions](../faq/troubleshooting/why-cant-i-see-my-organization.md).

## Updates on the Git provider

Expand Down
43 changes: 28 additions & 15 deletions docs/repositories-configure/codacy-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@ description: Use the Codacy configuration file to configure advanced features on

Codacy supports configuring certain advanced features through a configuration file, such as:

- Ignoring files globally, for duplication, or a specific tool
- [Ignoring files](#ignore-files) globally, for duplication, or a specific tool

- Adjusting [tool-specific configurations](#tool-conf)

- Configuring a specific repository directory on which to start the analysis

- Adding custom file extensions to languages, keeping in mind that some tools might not work out of the box with those extensions

- Adjusting [tool-specific configurations](#tool-specific-configurations)
## Using a Codacy configuration file

!!! note
- If a Codacy configuration file exists in your repository, the [Ignored files settings](ignoring-files.md) defined on the Codacy UI don't apply and you must ignore files using the configuration file instead.
- To disable a tool you must use the [Code patterns page](configuring-code-patterns.md) instead.
- {% include-markdown "../assets/includes/coverage-ignore.md" %}
!!! important
If your repository has a Codacy configuration file, the [Ignored files settings](ignoring-files.md) defined on the Codacy UI don't apply and you must [ignore files using the configuration file](#syntax-for-ignoring-files) instead.

To use a Codacy configuration file:

1. Create a text file with the name `.codacy.yml` or `.codacy.yaml` on the root of your repository.

The file must start with a line containing a triple dash (`---`).

1. Add your settings to the configuration file based on the example template below.

!!! important
The configuration file must start with a line containing a triple dash (`---`).
If you defined any [Ignored files settings](ignoring-files.md) for the repository, make sure you [add those settings](#syntax-for-ignoring-files) to the Codacy configuration file.

```yaml
---
Expand Down Expand Up @@ -59,7 +60,14 @@ To use a Codacy configuration file:
codacy-analysis-cli validate-configuration --directory `pwd`
```

## Syntax for ignoring files
## Ignoring files using a Codacy configuration file {: id="ignore-files"}

The Codacy configuration file gives you more flexibility in [ignoring or excluding files](ignoring-files.md) from the Codacy analysis.

!!! note
{% include-markdown "../assets/includes/coverage-ignore.md" %}

### Syntax for ignoring files

To ignore files using a Codacy configuration file, you must define one or more patterns under `exclude_paths` using the [Java glob syntax](https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher%28java.lang.String%29):

Expand All @@ -81,7 +89,12 @@ exclude_paths:
- "**/*.resource"
```

## Which tools can be configured and which name should I use?
## Adjusting tool configurations {: id="tool-conf"}

!!! note
The Codacy configuration file lets you [configure tools](#tool-specific-configurations), but you can't enable or disable them. A tool can only be enabled or disabled on the [Code patterns page](configuring-code-patterns.md) by users with the [necessary permissions](../organizations/roles-and-permissions-for-organizations.md).

### Which tools can be configured and which name should I use?

<!--NOTE
When adding a new supported tool, make sure that you update the following pages:
Expand Down Expand Up @@ -146,13 +159,13 @@ The following names are **deprecated** and shouldn't be used, although they're s
- `pylint` - Use the name `pylintpython3` for **Pylint**.
- `tailor` - The tool **Tailor** [is deprecated](../release-notes/cloud/cloud-2023-10-25-csslint-jshint-fauxpas-tailor-tslint-deprecation.md). If you are using **SwiftLint** instead, use the name `swiftlint`.

## Tool-specific configurations
### Tool-specific configurations

By default, Codacy tries to detect which language is used on each source code file, and uses a set of default options for identifying duplicate blocks of code. However, some false positives may occur.

The tools below support specifying the language or language version used in the source code files that you're analyzing, or tuning the duplication detection.

### Cppcheck
#### Cppcheck

If you're using Cppcheck to analyze C or C++ source code files, add the following configuration to your Codacy configuration file to define the programming language you're using. The supported languages are `c` and `c++`:

Expand All @@ -163,7 +176,7 @@ engines:
language: c++
```

### PHP_CodeSniffer
#### PHP_CodeSniffer

If you're using the [PHP Compatibility](https://github.com/PHPCompatibility/PHPCompatibility) coding standard for PHP_CodeSniffer, add the following configuration to your Codacy configuration file to [define the PHP version](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) you're using:

Expand All @@ -174,7 +187,7 @@ engines:
php_version: 5.5
```

### Legacy Pylint 1.9.*
#### Legacy Pylint 1.9.*

If you're using the legacy Pylint 1.9.* to analyze Python source code files, add the following configuration to your Codacy configuration file to define the Python language version you're using. The supported versions are `2` and `3`:

Expand All @@ -188,7 +201,7 @@ engines:
!!! tip
If you're using Python 3.4.\* or later as your programming language, disable the tool **Pylint (legacy)** and enable the tool **Pylint** on your repository [Code patterns page](configuring-code-patterns.md) instead. For more information, see [What's New in Pylint 2.0](https://pylint.pycqa.org/en/latest/whatsnew/2/2.0/index.html).

### PMD CPD (Duplication)
#### PMD CPD (Duplication)

<!--NOTE
Reference for all options:
Expand Down
26 changes: 17 additions & 9 deletions docs/repositories-configure/ignoring-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,37 @@ To exclude files from your repository analysis open your repository **Settings**

![Ignored files](images/ignored-files.png)

You can also ignore files using your own [tool configuration files](configuring-code-patterns.md#using-your-own-tool-configuration-files), although this depends on the option being supported by each tool.
!!! note
- See below the files that Codacy [ignores by default](#default-ignored-files).

- You can also ignore files using your own [tool configuration files](configuring-code-patterns.md#using-your-own-tool-configuration-files), although this depends on the option being supported by each tool.

- {% include-markdown "../assets/includes/coverage-ignore.md" %}

If you need more flexibility in ignoring files, use a Codacy configuration file to [define a custom list of file paths to exclude](codacy-configuration-file.md#syntax-for-ignoring-files).

!!! note
{% include-markdown "../assets/includes/coverage-ignore.md" %}
!!! important
If your repository has a [Codacy configuration file](codacy-configuration-file.md), the **Ignored files** settings defined on the Codacy UI don't apply and you must [ignore files using the configuration file](codacy-configuration-file.md#ignore-files) instead.

![Ignored files](images/ignored-files-configuration-file.png)

## Default ignored files

By default, Codacy ignores all the files that match the regular expressions below. If you want to override these defaults, use a Codacy configuration file to [define a custom list of file paths to exclude](codacy-configuration-file.md#syntax-for-ignoring-files).
By default, Codacy ignores all the files that match the regular expressions below.

```text
.*[\.-]min\.css
.*[\.-]min\.js
.*node_modules/.*
.*bower_components
.*bower_components/.*
.*vendor/.*
.*third[_-]?[Pp]arty
.*third[_-]?[Pp]arty/.*
.*docs?/.*
.*samples
.*samples?/.*
.*releases?/.*
.*builds
.*builds?/.*
.*dist/.*
.*external
.*external/.*
.*libs/.*
.*d3\.js
.*angular(-resource|)?\.js
Expand All @@ -52,4 +59,5 @@ By default, Codacy ignores all the files that match the regular expressions belo
.*bootstrap\.js
.*bootstrap\.css
.*font-awesome\.css
.*\.[Dd]esigner\.cs
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/repositories-configure/managing-branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ To change the default branch of your repository or start analyzing other branche

Enabling a new branch triggers an initial analysis of that branch and the analysis results and information for that branch will become available after the analysis is complete.

1. To change the default branch on Codacy, click the corresponding **Make default** link that appears when you hover the column **Default**. Changing the default branch on Codacy doesn't change the default branch on your Git provider.
1. To change the default branch on Codacy, click the corresponding **Make default** link that appears when you hover the column **Default**.

Changing the default branch on Codacy doesn't change the default branch on your Git provider. Likewise, changing the default branch on your Git provider doesn't change the default branch on Codacy.

!!! note
You can only set as default branch an already enabled branch.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pymdown-extensions==10.7.1
mkdocs-exclude-search==0.6.6
mkdocs-exclude==1.0.2
mkdocs-git-revision-date-localized-plugin==1.2.4
mkdocs-include-markdown-plugin==6.0.4
mkdocs-include-markdown-plugin==6.0.5
mkdocs-macros-plugin==1.0.5
mkdocs-meta-descriptions-plugin==3.0.0
mkdocs-monorepo-plugin==1.1.0
Expand Down

0 comments on commit a3baab2

Please sign in to comment.