Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
parenthesized_with_dangling_comments
in arguments formatter (#6376
) ## Summary Fixes an instability whereby this: ```python def get_recent_deployments(threshold_days: int) -> Set[str]: # Returns a list of deployments not older than threshold days # including `/root/zulip` directory if it exists. recent = set() threshold_date = datetime.datetime.now() - datetime.timedelta( # noqa: DTZ005 days=threshold_days ) ``` Was being formatted as: ```python def get_recent_deployments(threshold_days: int) -> Set[str]: # Returns a list of deployments not older than threshold days # including `/root/zulip` directory if it exists. recent = set() threshold_date = ( datetime.datetime.now() - datetime.timedelta(days=threshold_days) # noqa: DTZ005 ) ``` Which was in turn being formatted as: ```python def get_recent_deployments(threshold_days: int) -> Set[str]: # Returns a list of deployments not older than threshold days # including `/root/zulip` directory if it exists. recent = set() threshold_date = ( datetime.datetime.now() - datetime.timedelta(days=threshold_days) # noqa: DTZ005 ) ``` The second-to-third formattings still differs from Black because we aren't taking the line suffix into account when splitting (#6377), but the first formatting is correct and should be unchanged (i.e., the first-to-second formattings is incorrect, and fixed here). ## Test Plan `cargo run --bin ruff_dev -- format-dev --stability-check ../zulip`
- Loading branch information