Ignoring files#
Organization admins can manage access to this feature
Ignore generated code, third-party libraries, and other files that aren't relevant to your project, so that Codacy reports issues only on the code your team maintains. To ignore files, add ignore rules to your repository: each rule is a file, a folder, or a glob that Codacy skips during analysis. A glob is a path with wildcards, such as *.min.js.
Ignore rules apply to every branch of the repository, starting from the next analysis. Issues and security findings in the ignored files close as fixed.
Adding ignore rules#
To add ignore rules to a repository:
-
Open your repository Files page and select the Ignore rules tab.
-
Click Add ignore rule.
-
Under Paths, enter the file, folder, or glob to ignore. See how to write a path.
To add more than one rule at a time, click Add another path. You can add up to 10 paths at a time.
-
Optionally, expand Advanced options to:
- Tools: Select the tools that skip these paths. By default, a rule applies to All tools. See ignoring files for specific tools.
- Reason: Describe why you're ignoring these paths, for example
Generated code. The reason appears under the path on the list of ignore rules, so your team knows why the rule exists.
-
Click Add ignore rule.

You can also ignore a single file from the Files page: select the file and click Ignore file.

Writing a path#
Paths are relative to the root of your repository and use / to separate folders. They use the same glob syntax as exclude_paths in a Codacy configuration file:
| Path | Ignored files |
|---|---|
docs/** |
The folder docs and everything in it, including nested folders |
docs/* |
Only the files directly in the folder docs |
*.min.js |
All files ending in .min.js, in any folder |
docs/index.md |
The file docs/index.md |
To ignore a folder, end the path with /**, not with /. Codacy doesn't accept:
- Paths that start with
!. Add rules only for the paths that you want to ignore. To analyze files that a Codacy default ignores, see default ignored files. - Paths that use
\to separate folders. - Paths that match every file in the repository, such as
**.
Note
-
You can also ignore files using your own tool configuration files, although this depends on the option being supported by each tool.
-
To exclude files from coverage analysis only, you must ignore them directly in the tool you're using to generate coverage reports and ensure that the reports you upload to Codacy don't include coverage information for those files.
Ignoring files for specific tools#
By default, an ignore rule applies to all tools. To ignore a path only for some tools, select those tools under Advanced options › Tools when you add the rule, or under Tools when you edit it. The tools that you don't select still analyze the files.
For example, ignore tests/** only for the tools that report issues you don't fix in test code, and keep analyzing your tests for security issues with the other tools.
The Tools column on the list of ignore rules shows which tools each rule applies to.
Managing ignore rules#
The Matching files column shows how many files each rule ignores, counted on the last analysis of the default branch. A new rule shows Not analyzed yet until the next analysis. A rule with 0 matching files ignores nothing: check the path for a typo, or delete the rule.
To edit or delete a rule, click the ⋯ menu on its row. If you change a rule's path, Codacy replaces the rule with a new one, with you as the author. When you delete a rule, Codacy analyzes its files again from the next analysis and reports their issues.
The list also shows the paths that Codacy ignores by default that match files in your repository. You can't edit or delete them.
Choosing between ignore rules and a Codacy configuration file#
You can also ignore files with exclude_paths in a Codacy configuration file. If your repository has a .codacy.yml or .codacy.yaml file on its default branch, none of its ignore rules apply, even if the file doesn't use exclude_paths. The Ignore rules tab becomes read-only, and you ignore files by committing changes to the configuration file.
Use a configuration file if you need to analyze files that a Codacy default ignores, with include_paths, if you use it for other settings, or if you want changes to what Codacy ignores reviewed in pull requests. Otherwise, use ignore rules: you manage them on the Codacy UI, without a commit, and they apply to every branch.
To move to ignore rules, delete the configuration file from your default branch and then add its exclude_paths as ignore rules. The file's other settings stop applying too.
Limits#
Each repository can have up to:
- 5,000 file and folder rules.
- A limited number of globs. Plain folders, such as
docs/**, and lists of file extensions, such as**/*.{ts,tsx}, don't count toward this limit. A glob with several alternatives can count more than once.
When a repository reaches a limit, Codacy doesn't add the new rule and shows a message that names the limit. To add more rules, delete the rules that you no longer need, starting with the ones with 0 matching files, or replace several rules with one folder rule. For example, one rule src/generated/** replaces a rule for each file in that folder.
Default ignored files#
By default, Codacy ignores all the files that match the regular expressions below. If you need to analyze files that match these regular expressions, use a Codacy configuration file to define a custom list of file paths to include.
.*[\.-]min\.css
.*[\.-]min\.js
.*node_modules/.*
.*bower_components/.*
.*vendor/.*
.*third[_-]?[Pp]arty/.*
.*samples?/.*
.*releases?/.*
.*builds?/.*
.*dist/.*
.*external/.*
.*libs/.*
.*d3\.js
.*angular(-resource|)?\.js
.*select2(-resource|)?\.js
.*-ace\.js
.*typeahead\.js
.*jquery-ui\.js
.*reveal\.js
.*three\.js
.*chart\.js
.*jquery\.js
.*underscore\.js
.*lodash\.js
.*bootstrap\.js
.*bootstrap\.css
.*font-awesome\.css
.*\.[Dd]esigner\.cs
Was this page helpful?
Your feedback helps us improve the documentation.
255 characters left
Thanks for helping improve Codacy documentation.
For more detailed feedback, open an issue on GitHub.