Skip to content

Commit

Permalink
(🐞) Add the missing period in error message (#9485)
Browse files Browse the repository at this point in the history
<!--
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.
  • Loading branch information
KotlinIsland authored Jan 12, 2024
1 parent a31a314 commit 3daf6e1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ impl DunderReplacement {
"__delitem__" => Some(Self::MessageOnly("Use `del` statement")),
"__divmod__" => Some(Self::MessageOnly("Use `divmod()` builtin")),
"__format__" => Some(Self::MessageOnly(
"Use `format` builtin, format string method, or f-string.",
"Use `format` builtin, format string method, or f-string",
)),
"__fspath__" => Some(Self::MessageOnly("Use `os.fspath` function")),
"__get__" => Some(Self::MessageOnly("Use `get` method")),
"__getattr__" => Some(Self::MessageOnly(
"Access attribute directly or use getattr built-in function.",
"Access attribute directly or use getattr built-in function",
)),
"__getattribute__" => Some(Self::MessageOnly(
"Access attribute directly or use getattr built-in function.",
"Access attribute directly or use getattr built-in function",
)),
"__getitem__" => Some(Self::MessageOnly("Access item via subscript")),
"__init__" => Some(Self::MessageOnly("Instantiate class directly")),
Expand All @@ -304,7 +304,7 @@ impl DunderReplacement {
"__rpow__" => Some(Self::MessageOnly("Use ** operator or `pow()` builtin")),
"__set__" => Some(Self::MessageOnly("Use subscript assignment")),
"__setattr__" => Some(Self::MessageOnly(
"Mutate attribute directly or use setattr built-in function.",
"Mutate attribute directly or use setattr built-in function",
)),
"__setitem__" => Some(Self::MessageOnly("Use subscript assignment")),
"__truncate__" => Some(Self::MessageOnly("Use `math.trunc()` function")),
Expand Down

0 comments on commit 3daf6e1

Please sign in to comment.