mirror of https://github.com/astral-sh/ruff
Fix documentation for `no-return-argument-annotation-in-stub` [`PYI050`] (#7708)
## Summary The markdown documentation was present, but in the wrong place, so was not displaying on the website. I moved it and added some references. Related to #2646. ## Test Plan `python scripts/check_docs_formatted.py`
This commit is contained in:
parent
614a19cb4e
commit
dc51d03866
|
|
@ -8,11 +8,6 @@ use ruff_text_size::Ranged;
|
||||||
use crate::checkers::ast::Checker;
|
use crate::checkers::ast::Checker;
|
||||||
use crate::settings::types::PythonVersion::Py311;
|
use crate::settings::types::PythonVersion::Py311;
|
||||||
|
|
||||||
#[violation]
|
|
||||||
pub struct NoReturnArgumentAnnotationInStub {
|
|
||||||
module: TypingModule,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ## What it does
|
/// ## What it does
|
||||||
/// Checks for uses of `typing.NoReturn` (and `typing_extensions.NoReturn`) in
|
/// Checks for uses of `typing.NoReturn` (and `typing_extensions.NoReturn`) in
|
||||||
/// stubs.
|
/// stubs.
|
||||||
|
|
@ -37,6 +32,15 @@ pub struct NoReturnArgumentAnnotationInStub {
|
||||||
///
|
///
|
||||||
/// def foo(x: Never): ...
|
/// def foo(x: Never): ...
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// ## References
|
||||||
|
/// - [Python documentation: `typing.Never`](https://docs.python.org/3/library/typing.html#typing.Never)
|
||||||
|
/// - [Python documentation: `typing.NoReturn`](https://docs.python.org/3/library/typing.html#typing.NoReturn)
|
||||||
|
#[violation]
|
||||||
|
pub struct NoReturnArgumentAnnotationInStub {
|
||||||
|
module: TypingModule,
|
||||||
|
}
|
||||||
|
|
||||||
impl Violation for NoReturnArgumentAnnotationInStub {
|
impl Violation for NoReturnArgumentAnnotationInStub {
|
||||||
#[derive_message_formats]
|
#[derive_message_formats]
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ KNOWN_FORMATTING_VIOLATIONS = [
|
||||||
"multiple-statements-on-one-line-semicolon",
|
"multiple-statements-on-one-line-semicolon",
|
||||||
"no-blank-line-before-function",
|
"no-blank-line-before-function",
|
||||||
"no-indented-block-comment",
|
"no-indented-block-comment",
|
||||||
|
"no-return-argument-annotation-in-stub",
|
||||||
"no-space-after-block-comment",
|
"no-space-after-block-comment",
|
||||||
"no-space-after-inline-comment",
|
"no-space-after-inline-comment",
|
||||||
"non-empty-stub-body",
|
"non-empty-stub-body",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue