Skip to content

Commit 3daf6e1

Browse files
authored
(🐞) Add the missing period in error message (#9485)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> I noticed that there should be a missing period added to some of the new error messages for Unnecessary dunder call: ``` sandpit\test.py:6:16: PLC2801 Unnecessary dunder call to `__getattribute__`. Access attribute directly or use getattr built-in function.. ``` ## Test Plan Static analysis of the implementation, as this has no existing test cases.
1 parent a31a314 commit 3daf6e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ impl DunderReplacement {
283283
"__delitem__" => Some(Self::MessageOnly("Use `del` statement")),
284284
"__divmod__" => Some(Self::MessageOnly("Use `divmod()` builtin")),
285285
"__format__" => Some(Self::MessageOnly(
286-
"Use `format` builtin, format string method, or f-string.",
286+
"Use `format` builtin, format string method, or f-string",
287287
)),
288288
"__fspath__" => Some(Self::MessageOnly("Use `os.fspath` function")),
289289
"__get__" => Some(Self::MessageOnly("Use `get` method")),
290290
"__getattr__" => Some(Self::MessageOnly(
291-
"Access attribute directly or use getattr built-in function.",
291+
"Access attribute directly or use getattr built-in function",
292292
)),
293293
"__getattribute__" => Some(Self::MessageOnly(
294-
"Access attribute directly or use getattr built-in function.",
294+
"Access attribute directly or use getattr built-in function",
295295
)),
296296
"__getitem__" => Some(Self::MessageOnly("Access item via subscript")),
297297
"__init__" => Some(Self::MessageOnly("Instantiate class directly")),
@@ -304,7 +304,7 @@ impl DunderReplacement {
304304
"__rpow__" => Some(Self::MessageOnly("Use ** operator or `pow()` builtin")),
305305
"__set__" => Some(Self::MessageOnly("Use subscript assignment")),
306306
"__setattr__" => Some(Self::MessageOnly(
307-
"Mutate attribute directly or use setattr built-in function.",
307+
"Mutate attribute directly or use setattr built-in function",
308308
)),
309309
"__setitem__" => Some(Self::MessageOnly("Use subscript assignment")),
310310
"__truncate__" => Some(Self::MessageOnly("Use `math.trunc()` function")),

0 commit comments

Comments
 (0)