Skip to content

[flake8_bugbear] fix: improve docs for no_explicit_stacklevel#22538

Merged
dylwil3 merged 4 commits intoastral-sh:mainfrom
caiquejjx:fix-22395
Jan 30, 2026
Merged

[flake8_bugbear] fix: improve docs for no_explicit_stacklevel#22538
dylwil3 merged 4 commits intoastral-sh:mainfrom
caiquejjx:fix-22395

Conversation

@caiquejjx
Copy link
Contributor

Summary

Closes #22395

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Thanks!

@caiquejjx caiquejjx requested a review from dylwil3 January 12, 2026 20:50
@MichaReiser MichaReiser added the documentation Improvements or additions to documentation label Jan 13, 2026
///
/// In Python 3.12 and higher, one may also use `skip_file_prefixes` to specify
/// which file prefixes are ignored when counting the stack level. This implicitly overrides the `stacklevel` to be
/// at least 2, according to the [Python documentation].
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this link work? I don't think it will match up with the one below in the ## References section, but I'd have to test the docs locally to be sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I added now a reusable doc link that serves for both docs references nicely:

ruff.mov

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 20, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@dylwil3 dylwil3 merged commit 2b1e0f6 into astral-sh:main Jan 30, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-explicit-stacklevel (B028) should allow no stacklevel when skip_file_prefixes is provided

4 participants