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

Make warnings suppressable #275

Closed
renefritze opened this issue Mar 30, 2021 · 2 comments
Closed

Make warnings suppressable #275

renefritze opened this issue Mar 30, 2021 · 2 comments

Comments

@renefritze
Copy link
Contributor

I've been looking into workarounds for my problems in #264. One way I came up with was to suppress all warnings from sphinx-autoapi for the time being. To make this possible log messages would need to be emitted with setting a type argument whose value can be referenced in sphinx config's suppress_warnings list.
I've prototyped this here: master...renefritze:logging_types

I'd be willing to PR this for the whole extension if that's something you'd accept. I see no downside to doing that and it would be straightforward to do with only two minor questions:

  1. There should a single source for the 'type' value. Where should that go?
  2. Should all logging functions get the type arg or just warning?
@AWhetter
Copy link
Collaborator

AWhetter commented Apr 1, 2021

This sounds like a good idea to me.

  1. I'm not fussed about there being a single source. I'm happy for us to type out the type every time. We should document it though.
  2. Sphinx only uses the type and subtype on warning records so far as I can tell. So let's add them only to warning calls.

It would be nice to come up with appropriate subtypes as well. I'm thinking python_import_resolution for anything to do with resolving placeholders. not_readable for the warning about being unable to read a file because this is consistent with what Sphinx uses for its own subtypes. "Unknown type" should possibly be an error so leave that one out for now. "Invalid all entry" could be invalid_sources.

@AWhetter
Copy link
Collaborator

Fixed via #277

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

No branches or pull requests

2 participants