# Cannot get "Ignore" in codecov.yml to work

**URL:** <https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378>\
**Category:** Support\
**Created:** [May 5, 2020, 4:35pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378 "2020-05-05T16:35:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 4:35pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/1 "2020-05-05T16:35:59Z")

</div>

### Description

I was trying to ignore the “test” folder from my C++ project.  
Could not get it done, so I tried ignoring any file, but seems I cannot even do this 🙃.  
Yaml is codecov.yml on root folder.

### Repository

(private)

### Commit SHAs

c1a328a

### Codecov YAML

```
coverage:
  ignore:
    - "test/"
    - "*/**/test/*"
    - "**/test/"
    - "**/test/*"
    - " **/test/** /"
    - "**/*.gcov"
    - "**/*.cpp"
    - "**/*"
    - "*"
    - "**/*"
    - " **/**"
ignore:
  - "test/"
  - "*/**/test/*"
  - "**/test/"
  - "**/test/*"
  - " **/test/** /"
  - "**/*.gcov"
  - "**/*.cpp"
  - "**/*"
  - "*"
  - "**/*"
  - " **/**"

```

### Additional Information

 ![Screenshot from 2020-05-05 19-33-20](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/1X/612055e5ad28c459c377a9396521d0346ac484fe.png)

If I also use “-t token” the report is uploaded and the page in [codecov.io](http://codecov.io) contains both src and test folders.

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 4:45pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/2 "2020-05-05T16:45:37Z")

</div>

![Screenshot from 2020-05-05 19-43-45](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/1X/945f2f3cc6fa86dd22fda4ea14445d5f39c6a5db.png)

---

<div class="post-metadata">

**Author:** ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)\
**Post date:** [May 5, 2020, 4:52pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/3 "2020-05-05T16:52:38Z")

</div>

```auto
ERROR GitHub HTTP 404 {"body":"{\"message\":\"Not Found\",\"documentation_url\":\"https:\/\/developer.github.com\/v3\/repos\/contents\/#get-contents\"}","bot":"gmargari","commit":"c1a328a"
--- snip---

```

GitHub is telling us it’s not there when we try to pull it. When you say root, do you mean to absolute root of the repository on GitHub, or in a folder that serves as the project root?

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 5:18pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/4 "2020-05-05T17:18:41Z")

</div>

Weird, I just copied the id from codecov report. c1a328aa7a7e3e0e45b495fba80cf3891f12c944 is the full commit from GitHub.

Yes, I mean the absolute root of repo on GitHub. Haven’t commited the yml though, just playing locally.

---

<div class="post-metadata">

**Author:** ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)\
**Post date:** [May 5, 2020, 6:11pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/5 "2020-05-05T18:11:48Z")

</div>

> [@gmargari](#):
>
> Haven’t commited the yml though, just playing locally.

That is why. We need to be able to pull the codecov.yml file from the repo in order to process it.

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 6:36pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/6 "2020-05-05T18:36:14Z")

</div>

Ah, I missed that. 😇

Maybe then this should be somehow documented more clearly? Because on the image I posted I was using the local yaml, the bash script was stating “Yaml found at: codecov.yml” but I could not understand why the _found and processed_ yml file was not working.

Also, your [https://codecov.io/bash](https://codecov.io/bash) mentions

> ```
> -y conf file Used to specify the location of the .codecov.yml config file
> 
> ```

which should probably fixed to reflect the fact `.codecov.yml` filename is not supported?

---

<div class="post-metadata">

**Author:** ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)\
**Post date:** [May 5, 2020, 6:40pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/7 "2020-05-05T18:40:23Z")

</div>

Part of the file are used by the bash uploader, most are server-side. I’ll try to think of a way to make this clearer.

Thanks for the catch on the bash uploader help, I’ll correct.

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 7:42pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/8 "2020-05-05T19:42:00Z")

</div>

So, I commited the file in `codecov/codecov.yml`. I call from my terminal the bash script with `-y codecov/codecov.yml`.

The uploader finds the yaml, but on the server the files are not filtered, meaning yaml was **not processed**.

If I `git mv codecov/codecov.yml codecov.yml`, commit, and the repeat, the files are filtered (yaml is read).

Am I missing something again? How can I have the file in a directory?

---

<div class="post-metadata">

**Author:** ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)\
**Post date:** [May 5, 2020, 7:44pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/9 "2020-05-05T19:44:15Z")

</div>

We currently only support the codecov.yml file in the `dev` or `.github` directories. Otherwise it needs to be in the repo root.

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 7:46pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/10 "2020-05-05T19:46:14Z")

</div>

So the line  
`codecov.yml in the project root. If placed elsewhere you need to pass -y <conf file> to the bash uploader`  
in [About the Codecov YAML](https://docs.codecov.io/docs/codecov-yaml) is not correct?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 5, 2020, 7:51pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/11 "2020-05-05T19:51:43Z")

</div>

Hi @gmargari, this is correct. We are in the middle of updating our docs to show this, and you have correctly pointed out where this is inaccurate. `codecov.yml` must be in the project root for our server-side to pick up the configuration.

---

<div class="post-metadata">

**Author:** ![gmargari](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/gmargari/32/732_2.png) [@gmargari](https://community.codecov.com/u/gmargari)\
**Post date:** [May 5, 2020, 7:54pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/12 "2020-05-05T19:54:15Z")

</div>

Ok, so then maybe the `-y` bash argument is misleading/could be removed, since there a few preconfigured places that the `codecov.yml` must be and user cannot set an arbitrary path.  
Thanks a bunch, finally got it work. 🙂

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 5, 2020, 7:56pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/13 "2020-05-05T19:56:17Z")

</div>

@gmargari, you are absolutely right and this is on us for not communicating this better. Glad that you got it to work!

---

<div class="post-metadata">

**Author:** ![rivy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/rivy/32/301_2.png) [@rivy](https://community.codecov.com/u/rivy)\
**Post date:** [May 6, 2020, 8:11pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/14 "2020-05-06T20:11:21Z")

</div>

Just out of curiosity, why is “.codecov.yml” not supported, as well?

---

<div class="post-metadata">

**Author:** ![PaulRBerg](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/paulrberg/32/2800_2.png) [@PaulRBerg](https://community.codecov.com/u/PaulRBerg)\
**Post date:** [February 6, 2023, 2:09pm UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/15 "2023-02-06T14:09:26Z")

</div>

Came here to ask the same question as @rivy. I can’t get the ignore paths to work with the `.codecov.yml` file. Why is this config file name not supported, when the [docs](https://docs.codecov.com/docs/codecov-yaml#can-i-name-the-file-codecovyml) say this:

> **Can I name the file .codecov.yml?**
> 
> Yes. However, the file must still be located in the repository root, `dev/` , or `.github/` directories

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [February 7, 2023, 1:22am UTC](https://community.codecov.com/t/cannot-get-ignore-in-codecov-yml-to-work/1378/16 "2023-02-07T01:22:22Z")

</div>

@PaulRBerg, I replied on [this topic](https://community.codecov.com/t/ignore-does-not-ignore-folders/922/3), but you do not have a valid bot/you did not install the GitHub app
