You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on May 21, 2025. It is now read-only.
Excluding lines with exclude_lines in .coveragerc does not work for me #107
Notice that exclude_lines is in the [report] section. I wonder if the .coverage data file contains the missing lines and that:
our local coverage-reporter uses this data file MINUS any lines that match the [report]:exclude_lines entries.
codecov uses only this data file as-is (does not honor exclude_lines).
If so, codecov will need to:
find the .coveragerc file (it can be placed anywhere and named anything)
remove any exclude_lines matched lines from their reporting.
If developers can't tell CI about the rc file, and if the CI can't tell CodeCov about the rc file, CodeCov could demand that the file is named .coveragerc and resides in the root directory.
I'm having the same issue - declaring exclude_lines in .coveragerc or in setup.cfg does not seem to have any effect on my Codecov reports, even though the configuration is reflected in my local coverage reports.
Any progress on this issue ? I have the same problem: both .coveragerc[report] section and setup.cfg[coverage:report] configurations are ignored by codecov.
My bad: it seems to work now. The secret seems to PUSH the .coveragerc file as it is not taken into account locally (the .coverage file and generated coverage.xml report do not contain anything about ignored lines, this is a post processing thing).
So in other words, the codecov platform seems to check the git files separately (not during report upload), and if a .coveragerc file is present, applies the exclude lines appropriately. Can anyone confirm ? What about using setup.cfg instead of .coveragerc, is this officially supported ?
EDIT: it seems that setup.cfg configuration is also correctly taken into account. So the secret is really to push these files to github before executing codecov
Activity
ldorau commentedon Aug 28, 2017
@sarahjelinek @marcinslusarz @GBuella
lingthio commentedon Sep 14, 2017
I'm running into the same issue.
Notice that
exclude_linesis in the[report]section. I wonder if the .coverage data file contains the missing lines and that:[report]:exclude_linesentries.exclude_lines).If so, codecov will need to:
exclude_linesmatched lines from their reporting.If developers can't tell CI about the rc file, and if the CI can't tell CodeCov about the rc file, CodeCov could demand that the file is named .coveragerc and resides in the root directory.
alejandrolujan commentedon May 23, 2018
I'm having the same issue - declaring
exclude_linesin.coveragercor insetup.cfgdoes not seem to have any effect on my Codecov reports, even though the configuration is reflected in my local coverage reports.Ademord commentedon Jun 13, 2018
Did anyone get this fixed? :(
alejandrolujan commentedon Aug 22, 2018
Any news w.r.t this issue? This is throwing off our coverage reports and creates noise for the team.
interDist commentedon Mar 1, 2020
everybody who complained about
.coveragercnot being taken into account -- shouldn't you specify all your settings incodecov.yml?..erwanp commentedon Apr 6, 2020
In my project I didn't manage to include the
exclude_linesin thecodecov.ymlbut it worked by adding a.coveragercon the side.smarie commentedon Mar 9, 2021
Any progress on this issue ? I have the same problem: both
.coveragerc[report]section andsetup.cfg[coverage:report]configurations are ignored bycodecov.@interDist :
This option is not present in the codecov.yml reference : https://docs.codecov.io/docs/codecovyml-reference#coverage
@erwanp : from your project sources and coverage reports it seems that this is not actually working, no ?
smarie commentedon Mar 9, 2021
My bad: it seems to work now. The secret seems to PUSH the .coveragerc file as it is not taken into account locally (the .coverage file and generated coverage.xml report do not contain anything about ignored lines, this is a post processing thing).
So in other words, the codecov platform seems to check the git files separately (not during report upload), and if a .coveragerc file is present, applies the exclude lines appropriately. Can anyone confirm ? What about using
setup.cfginstead of.coveragerc, is this officially supported ?EDIT: it seems that
setup.cfgconfiguration is also correctly taken into account. So the secret is really to push these files to github before executingcodecovssbarnea commentedon Nov 26, 2022
I guess that nobody looked at it and now we already migrated the config to pyproject.toml, which is likely fully ignored by codecov.