mirror of https://github.com/astral-sh/ruff
docs: 📝 Updating the example for `assert(S101)` (#6986)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Rewriting the `if`-comparison to focus on the meaning of rule ` assert S101`. Fixes #6984 ## Test Plan <!-- How was it tested? --> --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
f3aaf84a28
commit
dc4db39f78
|
|
@ -23,6 +23,10 @@ use ruff_text_size::Ranged;
|
|||
///
|
||||
/// Use instead:
|
||||
/// ```python
|
||||
/// if not x > 0:
|
||||
/// raise ValueError("Expected positive value.")
|
||||
///
|
||||
/// # or even better:
|
||||
/// if x <= 0:
|
||||
/// raise ValueError("Expected positive value.")
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Reference in New Issue