mirror of https://github.com/astral-sh/ruff
Improve magic value message wording (#1892)
The message previously specified 'number', but the error applies to more types.
This commit is contained in:
parent
c7d0d26981
commit
85bdb45eca
|
|
@ -1111,7 +1111,7 @@ For more, see [Pylint](https://pypi.org/project/pylint/2.15.7/) on PyPI.
|
||||||
| PLR0402 | ConsiderUsingFromImport | Use `from ... import ...` in lieu of alias | |
|
| PLR0402 | ConsiderUsingFromImport | Use `from ... import ...` in lieu of alias | |
|
||||||
| PLR1701 | ConsiderMergingIsinstance | Merge these isinstance calls: `isinstance(..., (...))` | |
|
| PLR1701 | ConsiderMergingIsinstance | Merge these isinstance calls: `isinstance(..., (...))` | |
|
||||||
| PLR1722 | UseSysExit | Use `sys.exit()` instead of `exit` | 🛠 |
|
| PLR1722 | UseSysExit | Use `sys.exit()` instead of `exit` | 🛠 |
|
||||||
| PLR2004 | MagicValueComparison | Magic number used in comparison, consider replacing magic with a constant variable | |
|
| PLR2004 | MagicValueComparison | Magic value used in comparison, consider replacing magic with a constant variable | |
|
||||||
|
|
||||||
#### Warning (PLW)
|
#### Warning (PLW)
|
||||||
| Code | Name | Message | Fix |
|
| Code | Name | Message | Fix |
|
||||||
|
|
|
||||||
|
|
@ -1277,7 +1277,7 @@ impl Violation for MagicValueComparison {
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
let MagicValueComparison(value) = self;
|
let MagicValueComparison(value) = self;
|
||||||
format!(
|
format!(
|
||||||
"Magic number used in comparison, consider replacing {value} with a constant variable"
|
"Magic value used in comparison, consider replacing {value} with a constant variable"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue