Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command line option to show current configuration #1114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smcavallo
Copy link

It's useful to be able to determine in advance of running an analysis what the current configuration is.
This adds support for exposing the end resulting configuration via cmd
ex.
coverage config --show-omit -o json

Signed-off-by: smcavallo [email protected]

@nedbat
Copy link
Owner

nedbat commented Feb 6, 2021

Thanks for the pull request. I haven't tried running it, but isn't this similar to what coverage debug config shows? If so, maybe we need to make it more apparent in the docs?

@smcavallo
Copy link
Author

Thanks for the pull request. I haven't tried running it, but isn't this similar to what coverage debug config shows? If so, maybe we need to make it more apparent in the docs?

Yes, thank you!!! I didn't know that existed. Very similar to what we are looking for.
We'd like to be able to:

  • Select a specific section of the config to query. Ex. coverage debug config run_omit
  • Have more control over the output format. Ex. coverage debug config run_omit -o json

Our use case is that we are using multiple code coverage tools, coveragepy being the primary and "source of truth." We need to use a consistent set of rules across all the tools. We need to be able to query the coveragepy rules in order to "share" those rules with our other downstream python linters and quality gates.
It would be easier if those other tools had native support for reading coveragepy files but they don't and I'm not sure it would make sense for them to know all the logic of how to do that anyways.
We are looking for a way to get the exclusion rules from coveragepy in a format we can easily parse.
I can add those additional command line options to coverage debug config if that's the best route and you would accept that contribution.

@nedbat
Copy link
Owner

nedbat commented Feb 6, 2021

I can see the value of parseable output from coverage debug config. I don't think I'd want to add a way to select the section to output though: once you have json output, the filtering can be done downstream.

@ProsperousHeart
Copy link
Contributor

Is this still valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants