mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:43 +00:00
Include docstrings for settings enum members (#1446)
This commit is contained in:
parent
16c4552946
commit
1c16255884
5 changed files with 54 additions and 15 deletions
|
@ -2461,7 +2461,7 @@ multiline-quotes = "single"
|
||||||
#### [`ban-relative-imports`](#ban-relative-imports)
|
#### [`ban-relative-imports`](#ban-relative-imports)
|
||||||
|
|
||||||
Whether to ban all relative imports (`"all"`), or only those imports
|
Whether to ban all relative imports (`"all"`), or only those imports
|
||||||
that extend into the parent module and beyond (`"parents"`).
|
that extend into the parent module or beyond (`"parents"`).
|
||||||
|
|
||||||
**Default value**: `"parents"`
|
**Default value**: `"parents"`
|
||||||
|
|
||||||
|
|
|
@ -918,11 +918,22 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Convention": {
|
"Convention": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"description": "Use Google-style docstrings.",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"google"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Use NumPy-style docstrings.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"google",
|
|
||||||
"numpy"
|
"numpy"
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"Flake8AnnotationsOptions": {
|
"Flake8AnnotationsOptions": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1065,7 +1076,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ban-relative-imports": {
|
"ban-relative-imports": {
|
||||||
"description": "Whether to ban all relative imports (`\"all\"`), or only those imports that extend into the parent module and beyond (`\"parents\"`).",
|
"description": "Whether to ban all relative imports (`\"all\"`), or only those imports that extend into the parent module or beyond (`\"parents\"`).",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Strictness"
|
"$ref": "#/definitions/Strictness"
|
||||||
|
@ -1261,11 +1272,22 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Quote": {
|
"Quote": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"description": "Use single quotes (`'`).",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"single"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Use double quotes (`\"`).",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"single",
|
|
||||||
"double"
|
"double"
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"SerializationFormat": {
|
"SerializationFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -1279,11 +1301,22 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Strictness": {
|
"Strictness": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"description": "Ban imports that extend into the parent module or beyond.",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"parents"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Ban all relative imports.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"parents",
|
|
||||||
"all"
|
"all"
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"Version": {
|
"Version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -7,7 +7,9 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||||
pub enum Quote {
|
pub enum Quote {
|
||||||
|
/// Use single quotes (`'`).
|
||||||
Single,
|
Single,
|
||||||
|
/// Use double quotes (`"`).
|
||||||
Double,
|
Double,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||||
pub enum Strictness {
|
pub enum Strictness {
|
||||||
|
/// Ban imports that extend into the parent module or beyond.
|
||||||
Parents,
|
Parents,
|
||||||
|
/// Ban all relative imports.
|
||||||
All,
|
All,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +31,7 @@ pub struct Options {
|
||||||
"#
|
"#
|
||||||
)]
|
)]
|
||||||
/// Whether to ban all relative imports (`"all"`), or only those imports
|
/// Whether to ban all relative imports (`"all"`), or only those imports
|
||||||
/// that extend into the parent module and beyond (`"parents"`).
|
/// that extend into the parent module or beyond (`"parents"`).
|
||||||
pub ban_relative_imports: Option<Strictness>,
|
pub ban_relative_imports: Option<Strictness>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||||
pub enum Convention {
|
pub enum Convention {
|
||||||
|
/// Use Google-style docstrings.
|
||||||
Google,
|
Google,
|
||||||
|
/// Use NumPy-style docstrings.
|
||||||
Numpy,
|
Numpy,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue