mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
add conventional xml.etree.ElementTree import alias (#12455)
This commit is contained in:
parent
3898d737d8
commit
fa2f3f9f2f
3 changed files with 3 additions and 1 deletions
|
@ -260,6 +260,7 @@ linter.flake8_import_conventions.aliases = {
|
||||||
seaborn = sns,
|
seaborn = sns,
|
||||||
tensorflow = tf,
|
tensorflow = tf,
|
||||||
tkinter = tk,
|
tkinter = tk,
|
||||||
|
xml.etree.ElementTree = ET,
|
||||||
}
|
}
|
||||||
linter.flake8_import_conventions.banned_aliases = {}
|
linter.flake8_import_conventions.banned_aliases = {}
|
||||||
linter.flake8_import_conventions.banned_from = []
|
linter.flake8_import_conventions.banned_from = []
|
||||||
|
|
|
@ -24,6 +24,7 @@ const CONVENTIONAL_ALIASES: &[(&str, &str)] = &[
|
||||||
("plotly.express", "px"),
|
("plotly.express", "px"),
|
||||||
("polars", "pl"),
|
("polars", "pl"),
|
||||||
("pyarrow", "pa"),
|
("pyarrow", "pa"),
|
||||||
|
("xml.etree.ElementTree", "ET"),
|
||||||
];
|
];
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize, CacheKey)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize, CacheKey)]
|
||||||
|
|
|
@ -1306,7 +1306,7 @@ pub struct Flake8ImportConventionsOptions {
|
||||||
/// The conventional aliases for imports. These aliases can be extended by
|
/// The conventional aliases for imports. These aliases can be extended by
|
||||||
/// the [`extend-aliases`](#lint_flake8-import-conventions_extend-aliases) option.
|
/// the [`extend-aliases`](#lint_flake8-import-conventions_extend-aliases) option.
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "tkinter": "tk", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa"}"#,
|
default = r#"{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "tkinter": "tk", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa", "xml.etree.ElementTree": "ET"}"#,
|
||||||
value_type = "dict[str, str]",
|
value_type = "dict[str, str]",
|
||||||
scope = "aliases",
|
scope = "aliases",
|
||||||
example = r#"
|
example = r#"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue