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

support for Twisted logging linting? #13

Open
glyph opened this issue Oct 26, 2018 · 2 comments
Open

support for Twisted logging linting? #13

glyph opened this issue Oct 26, 2018 · 2 comments

Comments

@glyph
Copy link

glyph commented Oct 26, 2018

Twisted's logger is quite similar in the syntax it supports (and given that it always uses format strings, and all kwargs go to fill it out, this might be even easier)?

We'd really love to have a linter that could address both of these. Would you consider adding support for https://twistedmatrix.com/documents/18.9.0/api/twisted.logger.html ? We've been discussing ways to catch and remove f-strings, .format calls, etc, and this is super close.

@jessemyers
Copy link
Contributor

We'd happily accept a PR along those lines. Lacking that, if you can write a (failing) unit test, I can likely update the AST traversal accordingly.

@tobixx
Copy link

tobixx commented Apr 21, 2023

As this is the only twisted related issue I would like to add a false-positive:
The

G010 [*] Logging statement uses `warn` instead of `warning`

If the logger is twisted.logger.Logger this is not the case, as there is only warn:
https://docs.twisted.org/en/latest/api/twisted.logger.Logger.html#warn

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

No branches or pull requests

3 participants