Skip to content
This documentation applies to Codacy Self-hosted

For the latest updates and improvements, see the latest Cloud documentation instead.

Codacy Configuration File

Codacy supports configuring certain advanced features through a configuration file.

You can exclude files using globs and add custom extensions to languages.

You can ignore files globally, for certain categories (duplication, metrics or coverage) or for a specific tool (e.g.: Rubocop). The category metrics refers to the information you find under File details such as Size, Structure and Complexity. 

To add custom extensions to a language you can also add an entry in this file, but keep in mind that some tools might not work out of the box with those extensions and might need changes.

If you want to disable an engine that needs to be done directly in the Code Patterns page.

The file name must be ".codacy.yaml" or ".codacy.yml" and should be placed in the root of your repository.

---
engines:
  rubocop:
    exclude_paths:
      - config/engines.yml
  duplication:
    exclude_paths:
      - config/engines.yml
  metric:
    exclude_paths:
      - config/engines.yml
  coverage:
    exclude_paths:
      - config/engines.yml
languages:
  css:
    extensions:
      - '-css.resource'
exclude_paths:
  - '.bundle/**'
  - 'spec/**/*'
  - 'benchmarks/**/*'
  - '**.min.js'
  - '**/tests/**'

If you wish to, you should use the following syntax:

'**.extension' ignores all files with the same extension across all your repository

'test/*' ignores all files in the root of test 'test/**' ignores everything inside test 'test/**/*' ignores all files inside sub-folder of test '**/*.resource' Ignores all .resource in all folders and sub-folders

To configure your 'exclude_paths', you can read more about the Java glob syntax.

Please note that if the file exists in the repo and if you have 'exclude paths', the UI ignores, will not apply.

Validating your configuration file

You can use the codacy-analysis-cli to validate the contents of your configuration file. Run the following command in the folder where the configuration file is located:

codacy-analysis-cli validate-configuration --directory `pwd`

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

All tools that Codacy supports are configurable using our configuration file. The names that should be used for each of them are:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
ameba
bandit
brakeman
bundleraudit
checkstyle
codacy-scalameta-pro
codenarc
coffeelint
cppcheck
credo
csslint
detekt
eslint
findbugs
findbugssec
flawfinder
golint
govet
hadolint
jacksonlinter
jshint
nsp
phpcs
phpmd
pmd-legacy
pmd
prospector
psscriptanalyzer
pylint
pylintpython3
remark-int
rubocop
scalastyle
scsslint
shellcheck
sonarscharp
spotbugs
SQLint
stylelint
swiftlint
tailor
tslint
tsqllint

If you have questions about Codacy configuration file, please, contact us.

Share your feedback 📢

Did this page help you?

Thanks for the feedback! Is there anything else you'd like to tell us about this page?

We're sorry to hear that. Please let us know what we can improve:

Alternatively, you can create a more detailed issue on our GitHub repository.

Thanks for helping improve the Codacy documentation.

If you have a question or need help please contact support@codacy.com.

Last modified July 22, 2020