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:
Tom Kuson 2023-09-29 17:48:51 +01:00 committed by GitHub
parent 614a19cb4e
commit dc51d03866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -8,11 +8,6 @@ use ruff_text_size::Ranged;
use crate::checkers::ast::Checker;
use crate::settings::types::PythonVersion::Py311;
#[violation]
pub struct NoReturnArgumentAnnotationInStub {
module: TypingModule,
}
/// ## What it does
/// Checks for uses of `typing.NoReturn` (and `typing_extensions.NoReturn`) in
/// stubs.
@ -37,6 +32,15 @@ pub struct NoReturnArgumentAnnotationInStub {
///
/// 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 {
#[derive_message_formats]
fn message(&self) -> String {

View file

@ -55,6 +55,7 @@ KNOWN_FORMATTING_VIOLATIONS = [
"multiple-statements-on-one-line-semicolon",
"no-blank-line-before-function",
"no-indented-block-comment",
"no-return-argument-annotation-in-stub",
"no-space-after-block-comment",
"no-space-after-inline-comment",
"non-empty-stub-body",