mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-15 22:14:44 +00:00
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
2 changed files with 10 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue