mirror of https://github.com/astral-sh/ruff
Tweak documentation for `FBT002` (#6556)
This commit is contained in:
parent
01eceaf0dc
commit
680d171ae5
|
|
@ -14,14 +14,15 @@ use crate::rules::flake8_boolean_trap::helpers::{add_if_boolean, is_allowed_func
|
|||
/// Calling a function with boolean default means that the keyword argument
|
||||
/// argument can be omitted, which makes the function call ambiguous.
|
||||
///
|
||||
/// Instead, define the relevant argument as keyword-only.
|
||||
/// Instead, consider defining the relevant argument as a required keyword
|
||||
/// argument to force callers to be explicit about their intent.
|
||||
///
|
||||
/// ## Example
|
||||
/// ```python
|
||||
/// from math import ceil, floor
|
||||
///
|
||||
///
|
||||
/// def round_number(number: float, *, up: bool = True) -> int:
|
||||
/// def round_number(number: float, up: bool = True) -> int:
|
||||
/// return ceil(number) if up else floor(number)
|
||||
///
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in New Issue