Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ use crate::{checkers::ast::Checker, fix::edits::add_argument};
/// It's recommended to use a `stacklevel` of 2 or higher, to give the caller
/// more context about the warning.
///
/// 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
Copy Markdown
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
Copy Markdown
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

/// ## Example
/// ```python
/// import warnings
Expand All @@ -39,7 +42,9 @@ use crate::{checkers::ast::Checker, fix::edits::add_argument};
/// higher stacklevel to address the diagnostic.
///
/// ## References
/// - [Python documentation: `warnings.warn`](https://docs.python.org/3/library/warnings.html#warnings.warn)
/// - [Python documentation: `warnings.warn`][Python documentation]
///
///[Python documentation]: https://docs.python.org/3/library/warnings.html#warnings.warn
#[derive(ViolationMetadata)]
#[violation_metadata(stable_since = "v0.0.257")]
pub(crate) struct NoExplicitStacklevel;
Expand Down