Skip to content

Commit 29dda16

Browse files
authored
ruff: Enable ruff's RUF027 to check f-string with missing prefix (#4364)
* ruff: Enable ruff's RUF027 rule to check f-string with f prefix * Fix a RUF207 violation
1 parent 886355f commit 29dda16

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pygmt/alias.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _to_string(
144144
if value not in mapping and value not in mapping.values():
145145
raise GMTValueError(
146146
value,
147-
description="value for parameter {name!r}" if name else "value",
147+
description=f"value for parameter {name!r}" if name else "value",
148148
choices=mapping.keys(),
149149
)
150150
value = mapping.get(value, value)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ extend-select = [
136136
"D410", # A blank line after section headings.
137137
"PLR6201", # Use a set literal when testing for membership
138138
"PLW1514", # {function_name} in text mode without explicit encoding argument
139+
"RUF027", # Possible f-string without an f prefix
139140
]
140141
ignore = [
141142
"COM812", # Do not always add the trailing commas

0 commit comments

Comments
 (0)