Skip to content

bpo-36853: Fix suspicious.py to actually print the unused rules#13579

Merged
jaraco merged 2 commits into
python:masterfrom
asottile:fix_unused_warning
Sep 2, 2019
Merged

bpo-36853: Fix suspicious.py to actually print the unused rules#13579
jaraco merged 2 commits into
python:masterfrom
asottile:fix_unused_warning

Conversation

@asottile

@asottile asottile commented May 26, 2019

Copy link
Copy Markdown
Contributor

There were two issues here:

  • self.warn isn't a thing in modern sphinx
  • logger.warning terminates immediately and then doesn't print the info lines below it

https://bugs.python.org/issue36853

Comment thread Doc/tools/extensions/suspicious.py Outdated

@tirkarthi tirkarthi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@tirkarthi

Copy link
Copy Markdown
Member

@JulienPalard Would be helpful to have a review of this. This fixes the error reported in https://bugs.python.org/issue36853. Thanks.

@asottile asottile changed the title Fix suspicious.py to actually print the unused rules bpo-36853: Fix suspicious.py to actually print the unused rules Jun 9, 2019
@drj11

drj11 commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

Ah, cool. I came here (independently) to report this bug, but found this PR that fixes it instead. :)

@asottile
asottile force-pushed the fix_unused_warning branch from c8f36d1 to f8391f7 Compare June 25, 2019 22:27
@asottile

Copy link
Copy Markdown
Contributor Author

seems @zooba also applied a similar patch, but used the deprecated logger.warn method

I've rebased this to resolve the conflicts

@asottile

Copy link
Copy Markdown
Contributor Author

In 60419a7

@asottile

asottile commented Jul 6, 2019

Copy link
Copy Markdown
Contributor Author

@jaraco anything left to do here?

@ned-deily

Copy link
Copy Markdown
Member

This PR seems to have stalled. @JulienPalard, can you take a look please?

@jaraco

jaraco commented Sep 2, 2019

Copy link
Copy Markdown
Member

Right. No need to leave this to languish longer.

@jaraco
jaraco merged commit e1786b5 into python:master Sep 2, 2019
@bedevere-bot

Copy link
Copy Markdown

@jaraco: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @asottile for the PR, and @jaraco for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 2, 2019
…onGH-13579)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
(cherry picked from commit e1786b5)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
@bedevere-bot

Copy link
Copy Markdown

GH-15649 is a backport of this pull request to the 3.8 branch.

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @asottile and @jaraco, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker e1786b54162e2bfb01ca5aafa19d596c4af5a803 3.7

jaraco pushed a commit that referenced this pull request Sep 2, 2019
…3579) (GH-15649)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
(cherry picked from commit e1786b5)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
@jaraco

jaraco commented Sep 2, 2019

Copy link
Copy Markdown
Member

@asottile Would you be willing to look at the cherry-pick? Thanks.

@asottile

asottile commented Sep 2, 2019

Copy link
Copy Markdown
Contributor Author

yep! will do

@asottile
asottile deleted the fix_unused_warning branch September 2, 2019 17:31
@bedevere-bot

Copy link
Copy Markdown

GH-15653 is a backport of this pull request to the 3.7 branch.

jaraco pushed a commit that referenced this pull request Sep 2, 2019
…) (#15653)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls

(cherry picked from commit e1786b5)
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…on#13579)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…on#13579)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…on#13579)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants