Skip to content

query: UP032 fix leaves bad formatting? #8683

@lucascolley

Description

@lucascolley

noted by @ilayn scipy/scipy#19516 (comment)

version: ruff 0.1.5

UP032 fix seems to leave some undesired formatting. In the case of SciPy where we want to run the linter without a formatter, this is less than ideal. Is this the intended behaviour, or could it be improved? Examples:

- raise ValueError("Conflicting configuration dicts: {!r} {!r}"
-                  "".format(new_dict, d))
+ raise ValueError(f"Conflicting configuration dicts: {new_dict!r} {d!r}"
+                  "")
+ raise ValueError("invalid number of data points ({}) specified"
+                  .format(tmp.shape[axis]))
- raise ValueError(f"invalid number of data points ({tmp.shape[axis]}) specified"
-                  )

Metadata

Metadata

Assignees

Labels

fixesRelated to suggested fixes for violations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions