mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
[UP008]: use super()
, not __super__
in error messages (#18743)
Some checks failed
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks-instrumented (push) Blocked by required conditions
CI / benchmarks-walltime (push) Blocked by required conditions
[ty Playground] Release / publish (push) Has been cancelled
Some checks failed
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks-instrumented (push) Blocked by required conditions
CI / benchmarks-walltime (push) Blocked by required conditions
[ty Playground] Release / publish (push) Has been cancelled
When I try to grep CPython with `__super__` I get 0 results: ``` (.venv) ~/Desktop/cpython main ✔ » ag __super__ . ``` That's how we can understand that the naming is not the best.
This commit is contained in:
parent
cb512ba80b
commit
2a425e43fd
2 changed files with 9 additions and 9 deletions
|
@ -58,7 +58,7 @@ impl AlwaysFixableViolation for SuperCallWithParameters {
|
|||
}
|
||||
|
||||
fn fix_title(&self) -> String {
|
||||
"Remove `__super__` parameters".to_string()
|
||||
"Remove `super()` parameters".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ UP008.py:17:23: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
18 | super(Child, self).method # wrong
|
||||
19 | super(
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
14 14 | Parent.super(1, 2) # ok
|
||||
|
@ -30,7 +30,7 @@ UP008.py:18:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
19 | super(
|
||||
20 | Child,
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
15 15 |
|
||||
|
@ -53,7 +53,7 @@ UP008.py:19:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
22 | | ).method() # wrong
|
||||
| |_________^ UP008
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
16 16 | def wrong(self):
|
||||
|
@ -76,7 +76,7 @@ UP008.py:36:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
| ^^^^^^^^^^^^^^^ UP008
|
||||
37 | super().f()
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
33 33 |
|
||||
|
@ -95,7 +95,7 @@ UP008.py:50:18: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
| ^^^^^^^^^^^^^^^ UP008
|
||||
51 | super().f()
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
47 47 | super(MyClass, self).f() # CANNOT use super()
|
||||
|
@ -115,7 +115,7 @@ UP008.py:74:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
| ^^^^^^^^^^^^^^^^^ UP008
|
||||
75 | super().f() # OK
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
71 71 | @dataclass
|
||||
|
@ -134,7 +134,7 @@ UP008.py:92:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
92 | super(__class__, self).foo()
|
||||
| ^^^^^^^^^^^^^^^^^ UP008
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
89 89 |
|
||||
|
@ -153,7 +153,7 @@ UP008.py:107:23: UP008 [*] Use `super()` instead of `super(__class__, self)`
|
|||
107 | builtins.super(C, self)
|
||||
| ^^^^^^^^^ UP008
|
||||
|
|
||||
= help: Remove `__super__` parameters
|
||||
= help: Remove `super()` parameters
|
||||
|
||||
ℹ Unsafe fix
|
||||
104 104 |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue