Ignore files from Codacy analysis

In some situations, you may want to exclude a few files from Codacy analysis and there are few ways for you to achieve this on Codacy. 


Project Settings

You can exclude some files from your project analysis on your Project Settings -> Ignored files and select the files you want to ignore. This view only shows the files that are on your main branch. 




Codacy configuration file

If you want to ignore files in a certain category (duplication, metrics or coverage) or in a specific tool (e.g. rubocop), you can create a file similar to the one below and add it to the root of the project with the files you want to ignore. This will ignore files in all branches

The file name must be ".codacy.yaml" or ".codacy.yml"

   enabled: true
     - config/engines.yml
   enabled: true
     - config/engines.yml
   enabled: true
     - config/engines.yml
   enabled: true
     - config/engines.yml
  - .bundle/
  - spec/**/*
  - benchmarks/**/*
  - '*.min.js'
If you wish to ignore all files with the same extension across all your repository, you should use the following syntax:


Please note that if the Codacy configuration file exists in the repo and if you have 'exclude paths' the settings defined in the UI (shown above), will not apply.


Other considerations about ignored files

In some cases, you can also ignore some files using your own configuration files although this depends on this option being supported by the tool itself.

Also there are few files that Codacy ignores by default, matching the following regular exceptions:


Have more questions? Submit a request


Please sign in to leave a comment.