bindings: python: selectively use f-strings
authorVincent Fazio <vfazio@xes-inc.com>
Thu, 14 Nov 2024 14:51:07 +0000 (08:51 -0600)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 19 Nov 2024 14:21:01 +0000 (15:21 +0100)
commit42308c2df11a6ec30661ba7d90a8afe368bb378b
tree728e97bad169dd68edf192dd8919d64811f71e1a
parentf3444341f4964b47f8e72f4ef697fad535d9dcc6
bindings: python: selectively use f-strings

Since their inclusion in Python 3.6, f-strings have become the preferred
way to format strings with variable values as they are generally more
readable as the value substitution is in place and doesn't have to be
parsed from the list or arguments to `.format()`.

Where it does not impact readability (when the line is <120 characters),
swap usage of `.format()` to an f-string.

For lines that are not converted, inform the linter to ignore attempts
to upgrade those instances to f-strings [0]

[0]: https://docs.astral.sh/ruff/rules/f-string/

Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20241114145116.2123714-15-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/python/gpiod/chip.py
bindings/python/gpiod/chip_info.py
bindings/python/gpiod/edge_event.py
bindings/python/gpiod/info_event.py
bindings/python/gpiod/line_info.py
bindings/python/gpiod/line_request.py
bindings/python/gpiod/line_settings.py