mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 19:27:11 +00:00
Document when a rule was added (#21035)
Summary -- Inspired by #20859, this PR adds the version a rule was added, and the file and line where it was defined, to `ViolationMetadata`. The file and line just use the standard `file!` and `line!` macros, while the more interesting version field uses a new `violation_metadata` attribute parsed by our `ViolationMetadata` derive macro. I moved the commit modifying all of the rule files to the end, so it should be a lot easier to review by omitting that one. As a curiosity and a bit of a sanity check, I also plotted the rule numbers over time: <img width="640" height="480" alt="image" src="https://github.com/user-attachments/assets/75b0b5cc-3521-4d40-a395-8807e6f4925f" /> I think this looks pretty reasonable and avoids some of the artifacts the earlier versions of the script ran into, such as the `rule` sub-command not being available or `--explain` requiring a file argument. <details><summary>Script and summary data</summary> ```shell gawk --csv ' NR > 1 { split($2, a, ".") major = a[1]; minor = a[2]; micro = a[3] # sum the number of rules added per minor version versions[minor] += 1 } END { tot = 0 for (i = 0; i <= 14; i++) { tot += versions[i] print i, tot } } ' ruff_rules_metadata.csv > summary.dat ``` ``` 0 696 1 768 2 778 3 803 4 822 5 848 6 855 7 865 8 893 9 915 10 916 11 924 12 929 13 932 14 933 ``` </details> Test Plan -- I built and viewed the documentation locally, and it looks pretty good! <img width="1466" height="676" alt="image" src="https://github.com/user-attachments/assets/5e227df4-7294-4d12-bdaa-31cac4e9ad5c" /> The spacing seems a bit awkward following the `h1` at the top, so I'm wondering if this might look nicer as a footer in Ruff. The links work well too: - [v0.0.271](https://github.com/astral-sh/ruff/releases/tag/v0.0.271) - [Related issues](https://github.com/astral-sh/ruff/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20airflow-variable-name-task-id-mismatch) - [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fruff_linter%2Fsrc%2Frules%2Fairflow%2Frules%2Ftask_variable_name.rs#L34) The last one even works on `main` now since it points to the `derive(ViolationMetadata)` line. In terms of binary size, this branch is a bit bigger than main with 38,654,520 bytes compared to 38,635,728 (+20 KB). I guess that's not _too_ much of an increase, but I wanted to check since we're generating a lot more code with macros. --------- Co-authored-by: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com>
This commit is contained in:
parent
48f1771877
commit
155fd603e8
703 changed files with 2105 additions and 1005 deletions
|
|
@ -25,6 +25,7 @@ struct Explanation<'a> {
|
||||||
explanation: Option<&'a str>,
|
explanation: Option<&'a str>,
|
||||||
preview: bool,
|
preview: bool,
|
||||||
status: RuleGroup,
|
status: RuleGroup,
|
||||||
|
source_location: SourceLocation,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Explanation<'a> {
|
impl<'a> Explanation<'a> {
|
||||||
|
|
@ -43,6 +44,10 @@ impl<'a> Explanation<'a> {
|
||||||
explanation: rule.explanation(),
|
explanation: rule.explanation(),
|
||||||
preview: rule.is_preview(),
|
preview: rule.is_preview(),
|
||||||
status: rule.group(),
|
status: rule.group(),
|
||||||
|
source_location: SourceLocation {
|
||||||
|
file: rule.file(),
|
||||||
|
line: rule.line(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -127,3 +132,14 @@ pub(crate) fn rules(format: HelpFormat) -> Result<()> {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The location of the rule's implementation in the Ruff source tree, relative to the repository
|
||||||
|
/// root.
|
||||||
|
///
|
||||||
|
/// For most rules this will point to the `#[derive(ViolationMetadata)]` line above the rule's
|
||||||
|
/// struct.
|
||||||
|
#[derive(Serialize)]
|
||||||
|
struct SourceLocation {
|
||||||
|
file: &'static str,
|
||||||
|
line: u32,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,11 @@ fn rule_f401() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rule_f401_output_json() {
|
fn rule_f401_output_json() {
|
||||||
assert_cmd_snapshot!(ruff_cmd().args(["rule", "F401", "--output-format", "json"]));
|
insta::with_settings!({filters => vec![
|
||||||
|
(r#"("file": ")[^"]+(",)"#, "$1<FILE>$2"),
|
||||||
|
]}, {
|
||||||
|
assert_cmd_snapshot!(ruff_cmd().args(["rule", "F401", "--output-format", "json"]));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,14 @@ exit_code: 0
|
||||||
"fix_availability": "Sometimes",
|
"fix_availability": "Sometimes",
|
||||||
"explanation": "## What it does\nChecks for unused imports.\n\n## Why is this bad?\nUnused imports add a performance overhead at runtime, and risk creating\nimport cycles. They also increase the cognitive load of reading the code.\n\nIf an import statement is used to check for the availability or existence\nof a module, consider using `importlib.util.find_spec` instead.\n\nIf an import statement is used to re-export a symbol as part of a module's\npublic interface, consider using a \"redundant\" import alias, which\ninstructs Ruff (and other tools) to respect the re-export, and avoid\nmarking it as unused, as in:\n\n```python\nfrom module import member as member\n```\n\nAlternatively, you can use `__all__` to declare a symbol as part of the module's\ninterface, as in:\n\n```python\n# __init__.py\nimport some_module\n\n__all__ = [\"some_module\"]\n```\n\n## Preview\nWhen [preview] is enabled (and certain simplifying assumptions\nare met), we analyze all import statements for a given module\nwhen determining whether an import is used, rather than simply\nthe last of these statements. This can result in both different and\nmore import statements being marked as unused.\n\nFor example, if a module consists of\n\n```python\nimport a\nimport a.b\n```\n\nthen both statements are marked as unused under [preview], whereas\nonly the second is marked as unused under stable behavior.\n\nAs another example, if a module consists of\n\n```python\nimport a.b\nimport a\n\na.b.foo()\n```\n\nthen a diagnostic will only be emitted for the first line under [preview],\nwhereas a diagnostic would only be emitted for the second line under\nstable behavior.\n\nNote that this behavior is somewhat subjective and is designed\nto conform to the developer's intuition rather than Python's actual\nexecution. To wit, the statement `import a.b` automatically executes\n`import a`, so in some sense `import a` is _always_ redundant\nin the presence of `import a.b`.\n\n\n## Fix safety\n\nFixes to remove unused imports are safe, except in `__init__.py` files.\n\nApplying fixes to `__init__.py` files is currently in preview. The fix offered depends on the\ntype of the unused import. Ruff will suggest a safe fix to export first-party imports with\neither a redundant alias or, if already present in the file, an `__all__` entry. If multiple\n`__all__` declarations are present, Ruff will not offer a fix. Ruff will suggest an unsafe fix\nto remove third-party and standard library imports -- the fix is unsafe because the module's\ninterface changes.\n\nSee [this FAQ section](https://docs.astral.sh/ruff/faq/#how-does-ruff-determine-which-of-my-imports-are-first-party-third-party-etc)\nfor more details on how Ruff\ndetermines whether an import is first or third-party.\n\n## Example\n\n```python\nimport numpy as np # unused import\n\n\ndef area(radius):\n return 3.14 * radius**2\n```\n\nUse instead:\n\n```python\ndef area(radius):\n return 3.14 * radius**2\n```\n\nTo check the availability of a module, use `importlib.util.find_spec`:\n\n```python\nfrom importlib.util import find_spec\n\nif find_spec(\"numpy\") is not None:\n print(\"numpy is installed\")\nelse:\n print(\"numpy is not installed\")\n```\n\n## Options\n- `lint.ignore-init-module-imports`\n- `lint.pyflakes.allowed-unused-imports`\n\n## References\n- [Python documentation: `import`](https://docs.python.org/3/reference/simple_stmts.html#the-import-statement)\n- [Python documentation: `importlib.util.find_spec`](https://docs.python.org/3/library/importlib.html#importlib.util.find_spec)\n- [Typing documentation: interface conventions](https://typing.python.org/en/latest/spec/distributing.html#library-interface-public-and-private-symbols)\n\n[preview]: https://docs.astral.sh/ruff/preview/\n",
|
"explanation": "## What it does\nChecks for unused imports.\n\n## Why is this bad?\nUnused imports add a performance overhead at runtime, and risk creating\nimport cycles. They also increase the cognitive load of reading the code.\n\nIf an import statement is used to check for the availability or existence\nof a module, consider using `importlib.util.find_spec` instead.\n\nIf an import statement is used to re-export a symbol as part of a module's\npublic interface, consider using a \"redundant\" import alias, which\ninstructs Ruff (and other tools) to respect the re-export, and avoid\nmarking it as unused, as in:\n\n```python\nfrom module import member as member\n```\n\nAlternatively, you can use `__all__` to declare a symbol as part of the module's\ninterface, as in:\n\n```python\n# __init__.py\nimport some_module\n\n__all__ = [\"some_module\"]\n```\n\n## Preview\nWhen [preview] is enabled (and certain simplifying assumptions\nare met), we analyze all import statements for a given module\nwhen determining whether an import is used, rather than simply\nthe last of these statements. This can result in both different and\nmore import statements being marked as unused.\n\nFor example, if a module consists of\n\n```python\nimport a\nimport a.b\n```\n\nthen both statements are marked as unused under [preview], whereas\nonly the second is marked as unused under stable behavior.\n\nAs another example, if a module consists of\n\n```python\nimport a.b\nimport a\n\na.b.foo()\n```\n\nthen a diagnostic will only be emitted for the first line under [preview],\nwhereas a diagnostic would only be emitted for the second line under\nstable behavior.\n\nNote that this behavior is somewhat subjective and is designed\nto conform to the developer's intuition rather than Python's actual\nexecution. To wit, the statement `import a.b` automatically executes\n`import a`, so in some sense `import a` is _always_ redundant\nin the presence of `import a.b`.\n\n\n## Fix safety\n\nFixes to remove unused imports are safe, except in `__init__.py` files.\n\nApplying fixes to `__init__.py` files is currently in preview. The fix offered depends on the\ntype of the unused import. Ruff will suggest a safe fix to export first-party imports with\neither a redundant alias or, if already present in the file, an `__all__` entry. If multiple\n`__all__` declarations are present, Ruff will not offer a fix. Ruff will suggest an unsafe fix\nto remove third-party and standard library imports -- the fix is unsafe because the module's\ninterface changes.\n\nSee [this FAQ section](https://docs.astral.sh/ruff/faq/#how-does-ruff-determine-which-of-my-imports-are-first-party-third-party-etc)\nfor more details on how Ruff\ndetermines whether an import is first or third-party.\n\n## Example\n\n```python\nimport numpy as np # unused import\n\n\ndef area(radius):\n return 3.14 * radius**2\n```\n\nUse instead:\n\n```python\ndef area(radius):\n return 3.14 * radius**2\n```\n\nTo check the availability of a module, use `importlib.util.find_spec`:\n\n```python\nfrom importlib.util import find_spec\n\nif find_spec(\"numpy\") is not None:\n print(\"numpy is installed\")\nelse:\n print(\"numpy is not installed\")\n```\n\n## Options\n- `lint.ignore-init-module-imports`\n- `lint.pyflakes.allowed-unused-imports`\n\n## References\n- [Python documentation: `import`](https://docs.python.org/3/reference/simple_stmts.html#the-import-statement)\n- [Python documentation: `importlib.util.find_spec`](https://docs.python.org/3/library/importlib.html#importlib.util.find_spec)\n- [Typing documentation: interface conventions](https://typing.python.org/en/latest/spec/distributing.html#library-interface-public-and-private-symbols)\n\n[preview]: https://docs.astral.sh/ruff/preview/\n",
|
||||||
"preview": false,
|
"preview": false,
|
||||||
"status": "Stable"
|
"status": {
|
||||||
|
"Stable": {
|
||||||
|
"since": "v0.0.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"source_location": {
|
||||||
|
"file": "<FILE>",
|
||||||
|
"line": 145
|
||||||
|
}
|
||||||
}
|
}
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use std::path::PathBuf;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use regex::{Captures, Regex};
|
use regex::{Captures, Regex};
|
||||||
|
use ruff_linter::codes::RuleGroup;
|
||||||
use strum::IntoEnumIterator;
|
use strum::IntoEnumIterator;
|
||||||
|
|
||||||
use ruff_linter::FixAvailability;
|
use ruff_linter::FixAvailability;
|
||||||
|
|
@ -31,6 +32,47 @@ pub(crate) fn main(args: &Args) -> Result<()> {
|
||||||
|
|
||||||
let _ = writeln!(&mut output, "# {} ({})", rule.name(), rule.noqa_code());
|
let _ = writeln!(&mut output, "# {} ({})", rule.name(), rule.noqa_code());
|
||||||
|
|
||||||
|
let status_text = match rule.group() {
|
||||||
|
RuleGroup::Stable { since } => {
|
||||||
|
format!(
|
||||||
|
r#"Added in <a href="https://github.com/astral-sh/ruff/releases/tag/{since}">{since}</a>"#
|
||||||
|
)
|
||||||
|
}
|
||||||
|
RuleGroup::Preview { since } => {
|
||||||
|
format!(
|
||||||
|
r#"Preview (since <a href="https://github.com/astral-sh/ruff/releases/tag/{since}">{since}</a>)"#
|
||||||
|
)
|
||||||
|
}
|
||||||
|
RuleGroup::Deprecated { since } => {
|
||||||
|
format!(
|
||||||
|
r#"Deprecated (since <a href="https://github.com/astral-sh/ruff/releases/tag/{since}">{since}</a>)"#
|
||||||
|
)
|
||||||
|
}
|
||||||
|
RuleGroup::Removed { since } => {
|
||||||
|
format!(
|
||||||
|
r#"Removed (since <a href="https://github.com/astral-sh/ruff/releases/tag/{since}">{since}</a>)"#
|
||||||
|
)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let _ = writeln!(
|
||||||
|
&mut output,
|
||||||
|
r#"<small>
|
||||||
|
{status_text} ·
|
||||||
|
<a href="https://github.com/astral-sh/ruff/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20(%27{encoded_name}%27%20OR%20{rule_code})" target="_blank">Related issues</a> ·
|
||||||
|
<a href="https://github.com/astral-sh/ruff/blob/main/{file}#L{line}" target="_blank">View source</a>
|
||||||
|
</small>
|
||||||
|
|
||||||
|
"#,
|
||||||
|
encoded_name =
|
||||||
|
url::form_urlencoded::byte_serialize(rule.name().as_str().as_bytes())
|
||||||
|
.collect::<String>(),
|
||||||
|
rule_code = rule.noqa_code(),
|
||||||
|
file =
|
||||||
|
url::form_urlencoded::byte_serialize(rule.file().replace('\\', "/").as_bytes())
|
||||||
|
.collect::<String>(),
|
||||||
|
line = rule.line(),
|
||||||
|
);
|
||||||
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
|
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
|
||||||
if linter.url().is_some() {
|
if linter.url().is_some() {
|
||||||
let common_prefix: String = match linter.common_prefix() {
|
let common_prefix: String = match linter.common_prefix() {
|
||||||
|
|
|
||||||
|
|
@ -32,20 +32,24 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
|
||||||
table_out.push('\n');
|
table_out.push('\n');
|
||||||
for rule in rules {
|
for rule in rules {
|
||||||
let status_token = match rule.group() {
|
let status_token = match rule.group() {
|
||||||
RuleGroup::Removed => {
|
RuleGroup::Removed { since } => {
|
||||||
format!(
|
format!(
|
||||||
"<span {SYMBOL_STYLE} title='Rule has been removed'>{REMOVED_SYMBOL}</span>"
|
"<span {SYMBOL_STYLE} title='Rule was removed in {since}'>{REMOVED_SYMBOL}</span>"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RuleGroup::Deprecated => {
|
RuleGroup::Deprecated { since } => {
|
||||||
format!(
|
format!(
|
||||||
"<span {SYMBOL_STYLE} title='Rule has been deprecated'>{WARNING_SYMBOL}</span>"
|
"<span {SYMBOL_STYLE} title='Rule has been deprecated since {since}'>{WARNING_SYMBOL}</span>"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RuleGroup::Preview => {
|
RuleGroup::Preview { since } => {
|
||||||
format!("<span {SYMBOL_STYLE} title='Rule is in preview'>{PREVIEW_SYMBOL}</span>")
|
format!(
|
||||||
|
"<span {SYMBOL_STYLE} title='Rule has been in preview since {since}'>{PREVIEW_SYMBOL}</span>"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
RuleGroup::Stable { since } => {
|
||||||
|
format!("<span {SYMBOL_STYLE} title='Rule has been stable since {since}'></span>")
|
||||||
}
|
}
|
||||||
RuleGroup::Stable => format!("<span {SYMBOL_STYLE}></span>"),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let fix_token = match rule.fixable() {
|
let fix_token = match rule.fixable() {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -150,7 +150,7 @@ mod tests {
|
||||||
for rule in Rule::iter() {
|
for rule in Rule::iter() {
|
||||||
let (code, group) = (rule.noqa_code(), rule.group());
|
let (code, group) = (rule.noqa_code(), rule.group());
|
||||||
|
|
||||||
if matches!(group, RuleGroup::Removed) {
|
if matches!(group, RuleGroup::Removed { .. }) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -209,15 +209,15 @@ impl RuleSelector {
|
||||||
self.all_rules().filter(move |rule| {
|
self.all_rules().filter(move |rule| {
|
||||||
match rule.group() {
|
match rule.group() {
|
||||||
// Always include stable rules
|
// Always include stable rules
|
||||||
RuleGroup::Stable => true,
|
RuleGroup::Stable { .. } => true,
|
||||||
// Enabling preview includes all preview rules unless explicit selection is turned on
|
// Enabling preview includes all preview rules unless explicit selection is turned on
|
||||||
RuleGroup::Preview => {
|
RuleGroup::Preview { .. } => {
|
||||||
preview_enabled && (self.is_exact() || !preview_require_explicit)
|
preview_enabled && (self.is_exact() || !preview_require_explicit)
|
||||||
}
|
}
|
||||||
// Deprecated rules are excluded by default unless explicitly selected
|
// Deprecated rules are excluded by default unless explicitly selected
|
||||||
RuleGroup::Deprecated => !preview_enabled && self.is_exact(),
|
RuleGroup::Deprecated { .. } => !preview_enabled && self.is_exact(),
|
||||||
// Removed rules are included if explicitly selected but will error downstream
|
// Removed rules are included if explicitly selected but will error downstream
|
||||||
RuleGroup::Removed => self.is_exact(),
|
RuleGroup::Removed { .. } => self.is_exact(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// dag = DAG(dag_id="my_dag", schedule=timedelta(days=1))
|
/// dag = DAG(dag_id="my_dag", schedule=timedelta(days=1))
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct AirflowDagNoScheduleArgument;
|
pub(crate) struct AirflowDagNoScheduleArgument;
|
||||||
|
|
||||||
impl Violation for AirflowDagNoScheduleArgument {
|
impl Violation for AirflowDagNoScheduleArgument {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::{FixAvailability, Violation};
|
||||||
/// fab_auth_manager_app = FabAuthManager().get_fastapi_app()
|
/// fab_auth_manager_app = FabAuthManager().get_fastapi_app()
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct Airflow3MovedToProvider<'a> {
|
pub(crate) struct Airflow3MovedToProvider<'a> {
|
||||||
deprecated: QualifiedName<'a>,
|
deprecated: QualifiedName<'a>,
|
||||||
replacement: ProviderReplacement,
|
replacement: ProviderReplacement,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use ruff_text_size::TextRange;
|
||||||
/// yesterday = today - timedelta(days=1)
|
/// yesterday = today - timedelta(days=1)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct Airflow3Removal {
|
pub(crate) struct Airflow3Removal {
|
||||||
deprecated: String,
|
deprecated: String,
|
||||||
replacement: Replacement,
|
replacement: Replacement,
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ use ruff_text_size::TextRange;
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct Airflow3SuggestedToMoveToProvider<'a> {
|
pub(crate) struct Airflow3SuggestedToMoveToProvider<'a> {
|
||||||
deprecated: QualifiedName<'a>,
|
deprecated: QualifiedName<'a>,
|
||||||
replacement: ProviderReplacement,
|
replacement: ProviderReplacement,
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ use ruff_text_size::TextRange;
|
||||||
/// Asset(uri="test://test/")
|
/// Asset(uri="test://test/")
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct Airflow3SuggestedUpdate {
|
pub(crate) struct Airflow3SuggestedUpdate {
|
||||||
deprecated: String,
|
deprecated: String,
|
||||||
replacement: Replacement,
|
replacement: Replacement,
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// my_task = PythonOperator(task_id="my_task")
|
/// my_task = PythonOperator(task_id="my_task")
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.271")]
|
||||||
pub(crate) struct AirflowVariableNameTaskIdMismatch {
|
pub(crate) struct AirflowVariableNameTaskIdMismatch {
|
||||||
task_id: String,
|
task_id: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ use crate::rules::eradicate::detection::comment_contains_code;
|
||||||
///
|
///
|
||||||
/// [#4845]: https://github.com/astral-sh/ruff/issues/4845
|
/// [#4845]: https://github.com/astral-sh/ruff/issues/4845
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.145")]
|
||||||
pub(crate) struct CommentedOutCode;
|
pub(crate) struct CommentedOutCode;
|
||||||
|
|
||||||
impl Violation for CommentedOutCode {
|
impl Violation for CommentedOutCode {
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ use ruff_python_ast::PythonVersion;
|
||||||
/// [typing-annotated]: https://docs.python.org/3/library/typing.html#typing.Annotated
|
/// [typing-annotated]: https://docs.python.org/3/library/typing.html#typing.Annotated
|
||||||
/// [typing-extensions]: https://typing-extensions.readthedocs.io/en/stable/
|
/// [typing-extensions]: https://typing-extensions.readthedocs.io/en/stable/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.8.0")]
|
||||||
pub(crate) struct FastApiNonAnnotatedDependency {
|
pub(crate) struct FastApiNonAnnotatedDependency {
|
||||||
py_version: PythonVersion,
|
py_version: PythonVersion,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ use crate::{AlwaysFixableViolation, Fix};
|
||||||
/// return item
|
/// return item
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.8.0")]
|
||||||
pub(crate) struct FastApiRedundantResponseModel;
|
pub(crate) struct FastApiRedundantResponseModel;
|
||||||
|
|
||||||
impl AlwaysFixableViolation for FastApiRedundantResponseModel {
|
impl AlwaysFixableViolation for FastApiRedundantResponseModel {
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ use crate::{FixAvailability, Violation};
|
||||||
/// This rule's fix is marked as unsafe, as modifying a function signature can
|
/// This rule's fix is marked as unsafe, as modifying a function signature can
|
||||||
/// change the behavior of the code.
|
/// change the behavior of the code.
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.10.0")]
|
||||||
pub(crate) struct FastApiUnusedPathParameter {
|
pub(crate) struct FastApiUnusedPathParameter {
|
||||||
arg_name: String,
|
arg_name: String,
|
||||||
function_name: String,
|
function_name: String,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use crate::rules::flake8_2020::helpers::is_sys;
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionCmpStr3;
|
pub(crate) struct SysVersionCmpStr3;
|
||||||
|
|
||||||
impl Violation for SysVersionCmpStr3 {
|
impl Violation for SysVersionCmpStr3 {
|
||||||
|
|
@ -91,6 +92,7 @@ impl Violation for SysVersionCmpStr3 {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionInfo0Eq3 {
|
pub(crate) struct SysVersionInfo0Eq3 {
|
||||||
eq: bool,
|
eq: bool,
|
||||||
}
|
}
|
||||||
|
|
@ -137,6 +139,7 @@ impl Violation for SysVersionInfo0Eq3 {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionInfo1CmpInt;
|
pub(crate) struct SysVersionInfo1CmpInt;
|
||||||
|
|
||||||
impl Violation for SysVersionInfo1CmpInt {
|
impl Violation for SysVersionInfo1CmpInt {
|
||||||
|
|
@ -179,6 +182,7 @@ impl Violation for SysVersionInfo1CmpInt {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionInfoMinorCmpInt;
|
pub(crate) struct SysVersionInfoMinorCmpInt;
|
||||||
|
|
||||||
impl Violation for SysVersionInfoMinorCmpInt {
|
impl Violation for SysVersionInfoMinorCmpInt {
|
||||||
|
|
@ -222,6 +226,7 @@ impl Violation for SysVersionInfoMinorCmpInt {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionCmpStr10;
|
pub(crate) struct SysVersionCmpStr10;
|
||||||
|
|
||||||
impl Violation for SysVersionCmpStr10 {
|
impl Violation for SysVersionCmpStr10 {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Six documentation: `six.PY2`](https://six.readthedocs.io/#six.PY2)
|
/// - [Six documentation: `six.PY2`](https://six.readthedocs.io/#six.PY2)
|
||||||
/// - [Six documentation: `six.PY3`](https://six.readthedocs.io/#six.PY3)
|
/// - [Six documentation: `six.PY3`](https://six.readthedocs.io/#six.PY3)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SixPY3;
|
pub(crate) struct SixPY3;
|
||||||
|
|
||||||
impl Violation for SixPY3 {
|
impl Violation for SixPY3 {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ use crate::rules::flake8_2020::helpers::is_sys;
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionSlice3;
|
pub(crate) struct SysVersionSlice3;
|
||||||
|
|
||||||
impl Violation for SysVersionSlice3 {
|
impl Violation for SysVersionSlice3 {
|
||||||
|
|
@ -78,6 +79,7 @@ impl Violation for SysVersionSlice3 {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersion2;
|
pub(crate) struct SysVersion2;
|
||||||
|
|
||||||
impl Violation for SysVersion2 {
|
impl Violation for SysVersion2 {
|
||||||
|
|
@ -118,6 +120,7 @@ impl Violation for SysVersion2 {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersion0;
|
pub(crate) struct SysVersion0;
|
||||||
|
|
||||||
impl Violation for SysVersion0 {
|
impl Violation for SysVersion0 {
|
||||||
|
|
@ -158,6 +161,7 @@ impl Violation for SysVersion0 {
|
||||||
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
/// - [Python documentation: `sys.version`](https://docs.python.org/3/library/sys.html#sys.version)
|
||||||
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
/// - [Python documentation: `sys.version_info`](https://docs.python.org/3/library/sys.html#sys.version_info)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.113")]
|
||||||
pub(crate) struct SysVersionSlice1;
|
pub(crate) struct SysVersionSlice1;
|
||||||
|
|
||||||
impl Violation for SysVersionSlice1 {
|
impl Violation for SysVersionSlice1 {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ use crate::{Edit, Fix, FixAvailability, Violation};
|
||||||
/// ## Options
|
/// ## Options
|
||||||
/// - `lint.flake8-annotations.suppress-dummy-args`
|
/// - `lint.flake8-annotations.suppress-dummy-args`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingTypeFunctionArgument {
|
pub(crate) struct MissingTypeFunctionArgument {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
@ -73,6 +74,7 @@ impl Violation for MissingTypeFunctionArgument {
|
||||||
/// ## Options
|
/// ## Options
|
||||||
/// - `lint.flake8-annotations.suppress-dummy-args`
|
/// - `lint.flake8-annotations.suppress-dummy-args`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingTypeArgs {
|
pub(crate) struct MissingTypeArgs {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
@ -108,6 +110,7 @@ impl Violation for MissingTypeArgs {
|
||||||
/// ## Options
|
/// ## Options
|
||||||
/// - `lint.flake8-annotations.suppress-dummy-args`
|
/// - `lint.flake8-annotations.suppress-dummy-args`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingTypeKwargs {
|
pub(crate) struct MissingTypeKwargs {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
@ -149,6 +152,7 @@ impl Violation for MissingTypeKwargs {
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
#[deprecated(note = "ANN101 has been removed")]
|
#[deprecated(note = "ANN101 has been removed")]
|
||||||
|
#[violation_metadata(removed_since = "0.8.0")]
|
||||||
pub(crate) struct MissingTypeSelf;
|
pub(crate) struct MissingTypeSelf;
|
||||||
|
|
||||||
#[expect(deprecated)]
|
#[expect(deprecated)]
|
||||||
|
|
@ -193,6 +197,7 @@ impl Violation for MissingTypeSelf {
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
#[deprecated(note = "ANN102 has been removed")]
|
#[deprecated(note = "ANN102 has been removed")]
|
||||||
|
#[violation_metadata(removed_since = "0.8.0")]
|
||||||
pub(crate) struct MissingTypeCls;
|
pub(crate) struct MissingTypeCls;
|
||||||
|
|
||||||
#[expect(deprecated)]
|
#[expect(deprecated)]
|
||||||
|
|
@ -236,6 +241,7 @@ impl Violation for MissingTypeCls {
|
||||||
///
|
///
|
||||||
/// - `lint.typing-extensions`
|
/// - `lint.typing-extensions`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingReturnTypeUndocumentedPublicFunction {
|
pub(crate) struct MissingReturnTypeUndocumentedPublicFunction {
|
||||||
name: String,
|
name: String,
|
||||||
annotation: Option<String>,
|
annotation: Option<String>,
|
||||||
|
|
@ -289,6 +295,7 @@ impl Violation for MissingReturnTypeUndocumentedPublicFunction {
|
||||||
///
|
///
|
||||||
/// - `lint.typing-extensions`
|
/// - `lint.typing-extensions`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingReturnTypePrivateFunction {
|
pub(crate) struct MissingReturnTypePrivateFunction {
|
||||||
name: String,
|
name: String,
|
||||||
annotation: Option<String>,
|
annotation: Option<String>,
|
||||||
|
|
@ -345,6 +352,7 @@ impl Violation for MissingReturnTypePrivateFunction {
|
||||||
/// self.x = x
|
/// self.x = x
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingReturnTypeSpecialMethod {
|
pub(crate) struct MissingReturnTypeSpecialMethod {
|
||||||
name: String,
|
name: String,
|
||||||
annotation: Option<String>,
|
annotation: Option<String>,
|
||||||
|
|
@ -392,6 +400,7 @@ impl Violation for MissingReturnTypeSpecialMethod {
|
||||||
/// return 1
|
/// return 1
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingReturnTypeStaticMethod {
|
pub(crate) struct MissingReturnTypeStaticMethod {
|
||||||
name: String,
|
name: String,
|
||||||
annotation: Option<String>,
|
annotation: Option<String>,
|
||||||
|
|
@ -439,6 +448,7 @@ impl Violation for MissingReturnTypeStaticMethod {
|
||||||
/// return 1
|
/// return 1
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.105")]
|
||||||
pub(crate) struct MissingReturnTypeClassMethod {
|
pub(crate) struct MissingReturnTypeClassMethod {
|
||||||
name: String,
|
name: String,
|
||||||
annotation: Option<String>,
|
annotation: Option<String>,
|
||||||
|
|
@ -508,6 +518,7 @@ impl Violation for MissingReturnTypeClassMethod {
|
||||||
/// - [Python documentation: `typing.Any`](https://docs.python.org/3/library/typing.html#typing.Any)
|
/// - [Python documentation: `typing.Any`](https://docs.python.org/3/library/typing.html#typing.Any)
|
||||||
/// - [Mypy documentation: The Any type](https://mypy.readthedocs.io/en/stable/kinds_of_types.html#the-any-type)
|
/// - [Mypy documentation: The Any type](https://mypy.readthedocs.io/en/stable/kinds_of_types.html#the-any-type)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.108")]
|
||||||
pub(crate) struct AnyType {
|
pub(crate) struct AnyType {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ use crate::rules::flake8_async::helpers::AsyncModule;
|
||||||
/// - [`anyio` events](https://anyio.readthedocs.io/en/latest/api.html#anyio.Event)
|
/// - [`anyio` events](https://anyio.readthedocs.io/en/latest/api.html#anyio.Event)
|
||||||
/// - [`trio` events](https://trio.readthedocs.io/en/latest/reference-core.html#trio.Event)
|
/// - [`trio` events](https://trio.readthedocs.io/en/latest/reference-core.html#trio.Event)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct AsyncBusyWait {
|
pub(crate) struct AsyncBusyWait {
|
||||||
module: AsyncModule,
|
module: AsyncModule,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ use ruff_python_ast::PythonVersion;
|
||||||
///
|
///
|
||||||
/// ["structured concurrency"]: https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#timeouts-and-cancellation
|
/// ["structured concurrency"]: https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#timeouts-and-cancellation
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct AsyncFunctionWithTimeout {
|
pub(crate) struct AsyncFunctionWithTimeout {
|
||||||
module: AsyncModule,
|
module: AsyncModule,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct AsyncZeroSleep {
|
pub(crate) struct AsyncZeroSleep {
|
||||||
module: AsyncModule,
|
module: AsyncModule,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ...
|
/// ...
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct BlockingHttpCallInAsyncFunction;
|
pub(crate) struct BlockingHttpCallInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for BlockingHttpCallInAsyncFunction {
|
impl Violation for BlockingHttpCallInAsyncFunction {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// response = await client.get(...)
|
/// response = await client.get(...)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "0.12.11")]
|
||||||
pub(crate) struct BlockingHttpCallHttpxInAsyncFunction {
|
pub(crate) struct BlockingHttpCallHttpxInAsyncFunction {
|
||||||
name: String,
|
name: String,
|
||||||
call: String,
|
call: String,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// username = await loop.run_in_executor(None, input, "Username:")
|
/// username = await loop.run_in_executor(None, input, "Username:")
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "0.12.12")]
|
||||||
pub(crate) struct BlockingInputInAsyncFunction;
|
pub(crate) struct BlockingInputInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for BlockingInputInAsyncFunction {
|
impl Violation for BlockingInputInAsyncFunction {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// contents = await f.read()
|
/// contents = await f.read()
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct BlockingOpenCallInAsyncFunction;
|
pub(crate) struct BlockingOpenCallInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for BlockingOpenCallInAsyncFunction {
|
impl Violation for BlockingOpenCallInAsyncFunction {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ use ruff_text_size::Ranged;
|
||||||
/// new_path = os.path.join("/tmp/src/", path)
|
/// new_path = os.path.join("/tmp/src/", path)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "0.13.2")]
|
||||||
pub(crate) struct BlockingPathMethodInAsyncFunction {
|
pub(crate) struct BlockingPathMethodInAsyncFunction {
|
||||||
path_library: String,
|
path_library: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// asyncio.create_subprocess_shell(cmd)
|
/// asyncio.create_subprocess_shell(cmd)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct CreateSubprocessInAsyncFunction;
|
pub(crate) struct CreateSubprocessInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for CreateSubprocessInAsyncFunction {
|
impl Violation for CreateSubprocessInAsyncFunction {
|
||||||
|
|
@ -76,6 +77,7 @@ impl Violation for CreateSubprocessInAsyncFunction {
|
||||||
/// asyncio.create_subprocess_shell(cmd)
|
/// asyncio.create_subprocess_shell(cmd)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct RunProcessInAsyncFunction;
|
pub(crate) struct RunProcessInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for RunProcessInAsyncFunction {
|
impl Violation for RunProcessInAsyncFunction {
|
||||||
|
|
@ -120,6 +122,7 @@ impl Violation for RunProcessInAsyncFunction {
|
||||||
/// await asyncio.loop.run_in_executor(None, wait_for_process)
|
/// await asyncio.loop.run_in_executor(None, wait_for_process)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct WaitForProcessInAsyncFunction;
|
pub(crate) struct WaitForProcessInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for WaitForProcessInAsyncFunction {
|
impl Violation for WaitForProcessInAsyncFunction {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// await asyncio.sleep(1)
|
/// await asyncio.sleep(1)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct BlockingSleepInAsyncFunction;
|
pub(crate) struct BlockingSleepInAsyncFunction;
|
||||||
|
|
||||||
impl Violation for BlockingSleepInAsyncFunction {
|
impl Violation for BlockingSleepInAsyncFunction {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ use crate::rules::flake8_async::helpers::MethodName;
|
||||||
/// - [`anyio` timeouts](https://anyio.readthedocs.io/en/stable/cancellation.html)
|
/// - [`anyio` timeouts](https://anyio.readthedocs.io/en/stable/cancellation.html)
|
||||||
/// - [`trio` timeouts](https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts)
|
/// - [`trio` timeouts](https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.269")]
|
||||||
pub(crate) struct CancelScopeNoCheckpoint {
|
pub(crate) struct CancelScopeNoCheckpoint {
|
||||||
method_name: MethodName,
|
method_name: MethodName,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ use crate::{Edit, Fix, FixAvailability, Violation};
|
||||||
///
|
///
|
||||||
/// This fix is marked as unsafe as it changes program behavior.
|
/// This fix is marked as unsafe as it changes program behavior.
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.13.0")]
|
||||||
pub(crate) struct LongSleepNotForever {
|
pub(crate) struct LongSleepNotForever {
|
||||||
module: AsyncModule,
|
module: AsyncModule,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ use crate::{Edit, Fix, FixAvailability, Violation};
|
||||||
/// This rule's fix is marked as unsafe, as adding an `await` to a function
|
/// This rule's fix is marked as unsafe, as adding an `await` to a function
|
||||||
/// call changes its semantics and runtime behavior.
|
/// call changes its semantics and runtime behavior.
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct TrioSyncCall {
|
pub(crate) struct TrioSyncCall {
|
||||||
method_name: MethodName,
|
method_name: MethodName,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// raise ValueError("Expected positive value.")
|
/// raise ValueError("Expected positive value.")
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct Assert;
|
pub(crate) struct Assert;
|
||||||
|
|
||||||
impl Violation for Assert {
|
impl Violation for Assert {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `stat`](https://docs.python.org/3/library/stat.html)
|
/// - [Python documentation: `stat`](https://docs.python.org/3/library/stat.html)
|
||||||
/// - [Common Weakness Enumeration: CWE-732](https://cwe.mitre.org/data/definitions/732.html)
|
/// - [Common Weakness Enumeration: CWE-732](https://cwe.mitre.org/data/definitions/732.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.211")]
|
||||||
pub(crate) struct BadFilePermissions {
|
pub(crate) struct BadFilePermissions {
|
||||||
reason: Reason,
|
reason: Reason,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Django documentation: SQL injection protection](https://docs.djangoproject.com/en/dev/topics/security/#sql-injection-protection)
|
/// - [Django documentation: SQL injection protection](https://docs.djangoproject.com/en/dev/topics/security/#sql-injection-protection)
|
||||||
/// - [Common Weakness Enumeration: CWE-89](https://cwe.mitre.org/data/definitions/89.html)
|
/// - [Common Weakness Enumeration: CWE-89](https://cwe.mitre.org/data/definitions/89.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.5.0")]
|
||||||
pub(crate) struct DjangoExtra;
|
pub(crate) struct DjangoExtra;
|
||||||
|
|
||||||
impl Violation for DjangoExtra {
|
impl Violation for DjangoExtra {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Django documentation: SQL injection protection](https://docs.djangoproject.com/en/dev/topics/security/#sql-injection-protection)
|
/// - [Django documentation: SQL injection protection](https://docs.djangoproject.com/en/dev/topics/security/#sql-injection-protection)
|
||||||
/// - [Common Weakness Enumeration: CWE-89](https://cwe.mitre.org/data/definitions/89.html)
|
/// - [Common Weakness Enumeration: CWE-89](https://cwe.mitre.org/data/definitions/89.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct DjangoRawSql;
|
pub(crate) struct DjangoRawSql;
|
||||||
|
|
||||||
impl Violation for DjangoRawSql {
|
impl Violation for DjangoRawSql {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `exec`](https://docs.python.org/3/library/functions.html#exec)
|
/// - [Python documentation: `exec`](https://docs.python.org/3/library/functions.html#exec)
|
||||||
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct ExecBuiltin;
|
pub(crate) struct ExecBuiltin;
|
||||||
|
|
||||||
impl Violation for ExecBuiltin {
|
impl Violation for ExecBuiltin {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Flask documentation: Debug Mode](https://flask.palletsprojects.com/en/latest/quickstart/#debug-mode)
|
/// - [Flask documentation: Debug Mode](https://flask.palletsprojects.com/en/latest/quickstart/#debug-mode)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct FlaskDebugTrue;
|
pub(crate) struct FlaskDebugTrue;
|
||||||
|
|
||||||
impl Violation for FlaskDebugTrue {
|
impl Violation for FlaskDebugTrue {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-200](https://cwe.mitre.org/data/definitions/200.html)
|
/// - [Common Weakness Enumeration: CWE-200](https://cwe.mitre.org/data/definitions/200.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct HardcodedBindAllInterfaces;
|
pub(crate) struct HardcodedBindAllInterfaces;
|
||||||
|
|
||||||
impl Violation for HardcodedBindAllInterfaces {
|
impl Violation for HardcodedBindAllInterfaces {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ use crate::rules::flake8_bandit::helpers::{matches_password_name, string_literal
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct HardcodedPasswordDefault {
|
pub(crate) struct HardcodedPasswordDefault {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::rules::flake8_bandit::helpers::{matches_password_name, string_literal
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct HardcodedPasswordFuncArg {
|
pub(crate) struct HardcodedPasswordFuncArg {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use crate::rules::flake8_bandit::helpers::{matches_password_name, string_literal
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
/// - [Common Weakness Enumeration: CWE-259](https://cwe.mitre.org/data/definitions/259.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct HardcodedPasswordString {
|
pub(crate) struct HardcodedPasswordString {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ static SQL_REGEX: LazyLock<Regex> = LazyLock::new(|| {
|
||||||
/// - [B608: Test for SQL injection](https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html)
|
/// - [B608: Test for SQL injection](https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html)
|
||||||
/// - [psycopg3: Server-side binding](https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html#server-side-binding)
|
/// - [psycopg3: Server-side binding](https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html#server-side-binding)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.245")]
|
||||||
pub(crate) struct HardcodedSQLExpression;
|
pub(crate) struct HardcodedSQLExpression;
|
||||||
|
|
||||||
impl Violation for HardcodedSQLExpression {
|
impl Violation for HardcodedSQLExpression {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Common Weakness Enumeration: CWE-379](https://cwe.mitre.org/data/definitions/379.html)
|
/// - [Common Weakness Enumeration: CWE-379](https://cwe.mitre.org/data/definitions/379.html)
|
||||||
/// - [Python documentation: `tempfile`](https://docs.python.org/3/library/tempfile.html)
|
/// - [Python documentation: `tempfile`](https://docs.python.org/3/library/tempfile.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.211")]
|
||||||
pub(crate) struct HardcodedTempFile {
|
pub(crate) struct HardcodedTempFile {
|
||||||
string: String,
|
string: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ use crate::rules::flake8_bandit::helpers::string_literal;
|
||||||
/// - [Common Weakness Enumeration: CWE-328](https://cwe.mitre.org/data/definitions/328.html)
|
/// - [Common Weakness Enumeration: CWE-328](https://cwe.mitre.org/data/definitions/328.html)
|
||||||
/// - [Common Weakness Enumeration: CWE-916](https://cwe.mitre.org/data/definitions/916.html)
|
/// - [Common Weakness Enumeration: CWE-916](https://cwe.mitre.org/data/definitions/916.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.212")]
|
||||||
pub(crate) struct HashlibInsecureHashFunction {
|
pub(crate) struct HashlibInsecureHashFunction {
|
||||||
library: String,
|
library: String,
|
||||||
string: String,
|
string: String,
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Jinja documentation: API](https://jinja.palletsprojects.com/en/latest/api/#autoescaping)
|
/// - [Jinja documentation: API](https://jinja.palletsprojects.com/en/latest/api/#autoescaping)
|
||||||
/// - [Common Weakness Enumeration: CWE-94](https://cwe.mitre.org/data/definitions/94.html)
|
/// - [Common Weakness Enumeration: CWE-94](https://cwe.mitre.org/data/definitions/94.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.220")]
|
||||||
pub(crate) struct Jinja2AutoescapeFalse {
|
pub(crate) struct Jinja2AutoescapeFalse {
|
||||||
value: bool,
|
value: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `logging.config.listen()`](https://docs.python.org/3/library/logging.config.html#logging.config.listen)
|
/// - [Python documentation: `logging.config.listen()`](https://docs.python.org/3/library/logging.config.html#logging.config.listen)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.231")]
|
||||||
pub(crate) struct LoggingConfigInsecureListen;
|
pub(crate) struct LoggingConfigInsecureListen;
|
||||||
|
|
||||||
impl Violation for LoggingConfigInsecureListen {
|
impl Violation for LoggingConfigInsecureListen {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [OpenStack security: Cross site scripting XSS](https://security.openstack.org/guidelines/dg_cross-site-scripting-xss.html)
|
/// - [OpenStack security: Cross site scripting XSS](https://security.openstack.org/guidelines/dg_cross-site-scripting-xss.html)
|
||||||
/// - [Common Weakness Enumeration: CWE-80](https://cwe.mitre.org/data/definitions/80.html)
|
/// - [Common Weakness Enumeration: CWE-80](https://cwe.mitre.org/data/definitions/80.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct MakoTemplates;
|
pub(crate) struct MakoTemplates;
|
||||||
|
|
||||||
impl Violation for MakoTemplates {
|
impl Violation for MakoTemplates {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
||||||
/// - [Paramiko documentation: `SSHClient.exec_command()`](https://docs.paramiko.org/en/stable/api/client.html#paramiko.client.SSHClient.exec_command)
|
/// - [Paramiko documentation: `SSHClient.exec_command()`](https://docs.paramiko.org/en/stable/api/client.html#paramiko.client.SSHClient.exec_command)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.270")]
|
||||||
pub(crate) struct ParamikoCall;
|
pub(crate) struct ParamikoCall;
|
||||||
|
|
||||||
impl Violation for ParamikoCall {
|
impl Violation for ParamikoCall {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-295](https://cwe.mitre.org/data/definitions/295.html)
|
/// - [Common Weakness Enumeration: CWE-295](https://cwe.mitre.org/data/definitions/295.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.213")]
|
||||||
pub(crate) struct RequestWithNoCertValidation {
|
pub(crate) struct RequestWithNoCertValidation {
|
||||||
string: String,
|
string: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Requests documentation: Timeouts](https://requests.readthedocs.io/en/latest/user/advanced/#timeouts)
|
/// - [Requests documentation: Timeouts](https://requests.readthedocs.io/en/latest/user/advanced/#timeouts)
|
||||||
/// - [httpx documentation: Timeouts](https://www.python-httpx.org/advanced/timeouts/)
|
/// - [httpx documentation: Timeouts](https://www.python-httpx.org/advanced/timeouts/)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.213")]
|
||||||
pub(crate) struct RequestWithoutTimeout {
|
pub(crate) struct RequestWithoutTimeout {
|
||||||
implicit: bool,
|
implicit: bool,
|
||||||
module: String,
|
module: String,
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ use crate::{
|
||||||
/// - [Python documentation: `subprocess` — Subprocess management](https://docs.python.org/3/library/subprocess.html)
|
/// - [Python documentation: `subprocess` — Subprocess management](https://docs.python.org/3/library/subprocess.html)
|
||||||
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct SubprocessPopenWithShellEqualsTrue {
|
pub(crate) struct SubprocessPopenWithShellEqualsTrue {
|
||||||
safety: Safety,
|
safety: Safety,
|
||||||
is_exact: bool,
|
is_exact: bool,
|
||||||
|
|
@ -79,6 +80,7 @@ impl Violation for SubprocessPopenWithShellEqualsTrue {
|
||||||
///
|
///
|
||||||
/// [#4045]: https://github.com/astral-sh/ruff/issues/4045
|
/// [#4045]: https://github.com/astral-sh/ruff/issues/4045
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct SubprocessWithoutShellEqualsTrue;
|
pub(crate) struct SubprocessWithoutShellEqualsTrue;
|
||||||
|
|
||||||
impl Violation for SubprocessWithoutShellEqualsTrue {
|
impl Violation for SubprocessWithoutShellEqualsTrue {
|
||||||
|
|
@ -117,6 +119,7 @@ impl Violation for SubprocessWithoutShellEqualsTrue {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: Security Considerations](https://docs.python.org/3/library/subprocess.html#security-considerations)
|
/// - [Python documentation: Security Considerations](https://docs.python.org/3/library/subprocess.html#security-considerations)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct CallWithShellEqualsTrue {
|
pub(crate) struct CallWithShellEqualsTrue {
|
||||||
is_exact: bool,
|
is_exact: bool,
|
||||||
}
|
}
|
||||||
|
|
@ -169,6 +172,7 @@ impl Violation for CallWithShellEqualsTrue {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `subprocess`](https://docs.python.org/3/library/subprocess.html)
|
/// - [Python documentation: `subprocess`](https://docs.python.org/3/library/subprocess.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct StartProcessWithAShell {
|
pub(crate) struct StartProcessWithAShell {
|
||||||
safety: Safety,
|
safety: Safety,
|
||||||
}
|
}
|
||||||
|
|
@ -210,6 +214,7 @@ impl Violation for StartProcessWithAShell {
|
||||||
///
|
///
|
||||||
/// [S605]: https://docs.astral.sh/ruff/rules/start-process-with-a-shell
|
/// [S605]: https://docs.astral.sh/ruff/rules/start-process-with-a-shell
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct StartProcessWithNoShell;
|
pub(crate) struct StartProcessWithNoShell;
|
||||||
|
|
||||||
impl Violation for StartProcessWithNoShell {
|
impl Violation for StartProcessWithNoShell {
|
||||||
|
|
@ -245,6 +250,7 @@ impl Violation for StartProcessWithNoShell {
|
||||||
/// - [Python documentation: `subprocess.Popen()`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen)
|
/// - [Python documentation: `subprocess.Popen()`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen)
|
||||||
/// - [Common Weakness Enumeration: CWE-426](https://cwe.mitre.org/data/definitions/426.html)
|
/// - [Common Weakness Enumeration: CWE-426](https://cwe.mitre.org/data/definitions/426.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.262")]
|
||||||
pub(crate) struct StartProcessWithPartialPath;
|
pub(crate) struct StartProcessWithPartialPath;
|
||||||
|
|
||||||
impl Violation for StartProcessWithPartialPath {
|
impl Violation for StartProcessWithPartialPath {
|
||||||
|
|
@ -278,6 +284,7 @@ impl Violation for StartProcessWithPartialPath {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
/// - [Common Weakness Enumeration: CWE-78](https://cwe.mitre.org/data/definitions/78.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.271")]
|
||||||
pub(crate) struct UnixCommandWildcardInjection;
|
pub(crate) struct UnixCommandWildcardInjection;
|
||||||
|
|
||||||
impl Violation for UnixCommandWildcardInjection {
|
impl Violation for UnixCommandWildcardInjection {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Cybersecurity and Infrastructure Security Agency (CISA): Alert TA17-156A](https://www.cisa.gov/news-events/alerts/2017/06/05/reducing-risk-snmp-abuse)
|
/// - [Cybersecurity and Infrastructure Security Agency (CISA): Alert TA17-156A](https://www.cisa.gov/news-events/alerts/2017/06/05/reducing-risk-snmp-abuse)
|
||||||
/// - [Common Weakness Enumeration: CWE-319](https://cwe.mitre.org/data/definitions/319.html)
|
/// - [Common Weakness Enumeration: CWE-319](https://cwe.mitre.org/data/definitions/319.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.218")]
|
||||||
pub(crate) struct SnmpInsecureVersion;
|
pub(crate) struct SnmpInsecureVersion;
|
||||||
|
|
||||||
impl Violation for SnmpInsecureVersion {
|
impl Violation for SnmpInsecureVersion {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Common Weakness Enumeration: CWE-319](https://cwe.mitre.org/data/definitions/319.html)
|
/// - [Common Weakness Enumeration: CWE-319](https://cwe.mitre.org/data/definitions/319.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.218")]
|
||||||
pub(crate) struct SnmpWeakCryptography;
|
pub(crate) struct SnmpWeakCryptography;
|
||||||
|
|
||||||
impl Violation for SnmpWeakCryptography {
|
impl Violation for SnmpWeakCryptography {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Paramiko documentation: set_missing_host_key_policy](https://docs.paramiko.org/en/latest/api/client.html#paramiko.client.SSHClient.set_missing_host_key_policy)
|
/// - [Paramiko documentation: set_missing_host_key_policy](https://docs.paramiko.org/en/latest/api/client.html#paramiko.client.SSHClient.set_missing_host_key_policy)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct SSHNoHostKeyVerification;
|
pub(crate) struct SSHNoHostKeyVerification;
|
||||||
|
|
||||||
impl Violation for SSHNoHostKeyVerification {
|
impl Violation for SSHNoHostKeyVerification {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ssl.wrap_socket(ssl_version=ssl.PROTOCOL_TLSv1_2)
|
/// ssl.wrap_socket(ssl_version=ssl.PROTOCOL_TLSv1_2)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct SslInsecureVersion {
|
pub(crate) struct SslInsecureVersion {
|
||||||
protocol: String,
|
protocol: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// def func(version=ssl.PROTOCOL_TLSv1_2): ...
|
/// def func(version=ssl.PROTOCOL_TLSv1_2): ...
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct SslWithBadDefaults {
|
pub(crate) struct SslWithBadDefaults {
|
||||||
protocol: String,
|
protocol: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ssl.wrap_socket(ssl_version=ssl.PROTOCOL_TLSv1_2)
|
/// ssl.wrap_socket(ssl_version=ssl.PROTOCOL_TLSv1_2)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct SslWithNoVersion;
|
pub(crate) struct SslWithNoVersion;
|
||||||
|
|
||||||
impl Violation for SslWithNoVersion {
|
impl Violation for SslWithNoVersion {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ use crate::preview::is_suspicious_function_reference_enabled;
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousPickleUsage;
|
pub(crate) struct SuspiciousPickleUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousPickleUsage {
|
impl Violation for SuspiciousPickleUsage {
|
||||||
|
|
@ -100,6 +101,7 @@ impl Violation for SuspiciousPickleUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousMarshalUsage;
|
pub(crate) struct SuspiciousMarshalUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousMarshalUsage {
|
impl Violation for SuspiciousMarshalUsage {
|
||||||
|
|
@ -150,6 +152,7 @@ impl Violation for SuspiciousMarshalUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousInsecureHashUsage;
|
pub(crate) struct SuspiciousInsecureHashUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousInsecureHashUsage {
|
impl Violation for SuspiciousInsecureHashUsage {
|
||||||
|
|
@ -192,6 +195,7 @@ impl Violation for SuspiciousInsecureHashUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousInsecureCipherUsage;
|
pub(crate) struct SuspiciousInsecureCipherUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousInsecureCipherUsage {
|
impl Violation for SuspiciousInsecureCipherUsage {
|
||||||
|
|
@ -236,6 +240,7 @@ impl Violation for SuspiciousInsecureCipherUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousInsecureCipherModeUsage;
|
pub(crate) struct SuspiciousInsecureCipherModeUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousInsecureCipherModeUsage {
|
impl Violation for SuspiciousInsecureCipherModeUsage {
|
||||||
|
|
@ -285,6 +290,7 @@ impl Violation for SuspiciousInsecureCipherModeUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousMktempUsage;
|
pub(crate) struct SuspiciousMktempUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousMktempUsage {
|
impl Violation for SuspiciousMktempUsage {
|
||||||
|
|
@ -325,6 +331,7 @@ impl Violation for SuspiciousMktempUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousEvalUsage;
|
pub(crate) struct SuspiciousEvalUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousEvalUsage {
|
impl Violation for SuspiciousEvalUsage {
|
||||||
|
|
@ -378,6 +385,7 @@ impl Violation for SuspiciousEvalUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousMarkSafeUsage;
|
pub(crate) struct SuspiciousMarkSafeUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousMarkSafeUsage {
|
impl Violation for SuspiciousMarkSafeUsage {
|
||||||
|
|
@ -430,6 +438,7 @@ impl Violation for SuspiciousMarkSafeUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousURLOpenUsage;
|
pub(crate) struct SuspiciousURLOpenUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousURLOpenUsage {
|
impl Violation for SuspiciousURLOpenUsage {
|
||||||
|
|
@ -472,6 +481,7 @@ impl Violation for SuspiciousURLOpenUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousNonCryptographicRandomUsage;
|
pub(crate) struct SuspiciousNonCryptographicRandomUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousNonCryptographicRandomUsage {
|
impl Violation for SuspiciousNonCryptographicRandomUsage {
|
||||||
|
|
@ -516,6 +526,7 @@ impl Violation for SuspiciousNonCryptographicRandomUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLCElementTreeUsage;
|
pub(crate) struct SuspiciousXMLCElementTreeUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLCElementTreeUsage {
|
impl Violation for SuspiciousXMLCElementTreeUsage {
|
||||||
|
|
@ -560,6 +571,7 @@ impl Violation for SuspiciousXMLCElementTreeUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLElementTreeUsage;
|
pub(crate) struct SuspiciousXMLElementTreeUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLElementTreeUsage {
|
impl Violation for SuspiciousXMLElementTreeUsage {
|
||||||
|
|
@ -604,6 +616,7 @@ impl Violation for SuspiciousXMLElementTreeUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLExpatReaderUsage;
|
pub(crate) struct SuspiciousXMLExpatReaderUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLExpatReaderUsage {
|
impl Violation for SuspiciousXMLExpatReaderUsage {
|
||||||
|
|
@ -648,6 +661,7 @@ impl Violation for SuspiciousXMLExpatReaderUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLExpatBuilderUsage;
|
pub(crate) struct SuspiciousXMLExpatBuilderUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLExpatBuilderUsage {
|
impl Violation for SuspiciousXMLExpatBuilderUsage {
|
||||||
|
|
@ -692,6 +706,7 @@ impl Violation for SuspiciousXMLExpatBuilderUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLSaxUsage;
|
pub(crate) struct SuspiciousXMLSaxUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLSaxUsage {
|
impl Violation for SuspiciousXMLSaxUsage {
|
||||||
|
|
@ -736,6 +751,7 @@ impl Violation for SuspiciousXMLSaxUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLMiniDOMUsage;
|
pub(crate) struct SuspiciousXMLMiniDOMUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLMiniDOMUsage {
|
impl Violation for SuspiciousXMLMiniDOMUsage {
|
||||||
|
|
@ -780,6 +796,7 @@ impl Violation for SuspiciousXMLMiniDOMUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousXMLPullDOMUsage;
|
pub(crate) struct SuspiciousXMLPullDOMUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLPullDOMUsage {
|
impl Violation for SuspiciousXMLPullDOMUsage {
|
||||||
|
|
@ -821,6 +838,7 @@ impl Violation for SuspiciousXMLPullDOMUsage {
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
/// [deprecated]: https://pypi.org/project/defusedxml/0.8.0rc2/#defusedxml-lxml
|
/// [deprecated]: https://pypi.org/project/defusedxml/0.8.0rc2/#defusedxml-lxml
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(removed_since = "0.12.0")]
|
||||||
pub(crate) struct SuspiciousXMLETreeUsage;
|
pub(crate) struct SuspiciousXMLETreeUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousXMLETreeUsage {
|
impl Violation for SuspiciousXMLETreeUsage {
|
||||||
|
|
@ -867,6 +885,7 @@ impl Violation for SuspiciousXMLETreeUsage {
|
||||||
/// [PEP 476]: https://peps.python.org/pep-0476/
|
/// [PEP 476]: https://peps.python.org/pep-0476/
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousUnverifiedContextUsage;
|
pub(crate) struct SuspiciousUnverifiedContextUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousUnverifiedContextUsage {
|
impl Violation for SuspiciousUnverifiedContextUsage {
|
||||||
|
|
@ -892,6 +911,7 @@ impl Violation for SuspiciousUnverifiedContextUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousTelnetUsage;
|
pub(crate) struct SuspiciousTelnetUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousTelnetUsage {
|
impl Violation for SuspiciousTelnetUsage {
|
||||||
|
|
@ -917,6 +937,7 @@ impl Violation for SuspiciousTelnetUsage {
|
||||||
///
|
///
|
||||||
/// [preview]: https://docs.astral.sh/ruff/preview/
|
/// [preview]: https://docs.astral.sh/ruff/preview/
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.258")]
|
||||||
pub(crate) struct SuspiciousFTPLibUsage;
|
pub(crate) struct SuspiciousFTPLibUsage;
|
||||||
|
|
||||||
impl Violation for SuspiciousFTPLibUsage {
|
impl Violation for SuspiciousFTPLibUsage {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `telnetlib` - Telnet client](https://docs.python.org/3.12/library/telnetlib.html#module-telnetlib)
|
/// - [Python documentation: `telnetlib` - Telnet client](https://docs.python.org/3.12/library/telnetlib.html#module-telnetlib)
|
||||||
/// - [PEP 594: `telnetlib`](https://peps.python.org/pep-0594/#telnetlib)
|
/// - [PEP 594: `telnetlib`](https://peps.python.org/pep-0594/#telnetlib)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousTelnetlibImport;
|
pub(crate) struct SuspiciousTelnetlibImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousTelnetlibImport {
|
impl Violation for SuspiciousTelnetlibImport {
|
||||||
|
|
@ -49,6 +50,7 @@ impl Violation for SuspiciousTelnetlibImport {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `ftplib` - FTP protocol client](https://docs.python.org/3/library/ftplib.html)
|
/// - [Python documentation: `ftplib` - FTP protocol client](https://docs.python.org/3/library/ftplib.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousFtplibImport;
|
pub(crate) struct SuspiciousFtplibImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousFtplibImport {
|
impl Violation for SuspiciousFtplibImport {
|
||||||
|
|
@ -74,6 +76,7 @@ impl Violation for SuspiciousFtplibImport {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `pickle` — Python object serialization](https://docs.python.org/3/library/pickle.html)
|
/// - [Python documentation: `pickle` — Python object serialization](https://docs.python.org/3/library/pickle.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousPickleImport;
|
pub(crate) struct SuspiciousPickleImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousPickleImport {
|
impl Violation for SuspiciousPickleImport {
|
||||||
|
|
@ -95,6 +98,7 @@ impl Violation for SuspiciousPickleImport {
|
||||||
/// import subprocess
|
/// import subprocess
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousSubprocessImport;
|
pub(crate) struct SuspiciousSubprocessImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousSubprocessImport {
|
impl Violation for SuspiciousSubprocessImport {
|
||||||
|
|
@ -118,6 +122,7 @@ impl Violation for SuspiciousSubprocessImport {
|
||||||
/// import xml.etree.cElementTree
|
/// import xml.etree.cElementTree
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlEtreeImport;
|
pub(crate) struct SuspiciousXmlEtreeImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlEtreeImport {
|
impl Violation for SuspiciousXmlEtreeImport {
|
||||||
|
|
@ -141,6 +146,7 @@ impl Violation for SuspiciousXmlEtreeImport {
|
||||||
/// import xml.sax
|
/// import xml.sax
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlSaxImport;
|
pub(crate) struct SuspiciousXmlSaxImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlSaxImport {
|
impl Violation for SuspiciousXmlSaxImport {
|
||||||
|
|
@ -164,6 +170,7 @@ impl Violation for SuspiciousXmlSaxImport {
|
||||||
/// import xml.dom.expatbuilder
|
/// import xml.dom.expatbuilder
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlExpatImport;
|
pub(crate) struct SuspiciousXmlExpatImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlExpatImport {
|
impl Violation for SuspiciousXmlExpatImport {
|
||||||
|
|
@ -187,6 +194,7 @@ impl Violation for SuspiciousXmlExpatImport {
|
||||||
/// import xml.dom.minidom
|
/// import xml.dom.minidom
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlMinidomImport;
|
pub(crate) struct SuspiciousXmlMinidomImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlMinidomImport {
|
impl Violation for SuspiciousXmlMinidomImport {
|
||||||
|
|
@ -210,6 +218,7 @@ impl Violation for SuspiciousXmlMinidomImport {
|
||||||
/// import xml.dom.pulldom
|
/// import xml.dom.pulldom
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlPulldomImport;
|
pub(crate) struct SuspiciousXmlPulldomImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlPulldomImport {
|
impl Violation for SuspiciousXmlPulldomImport {
|
||||||
|
|
@ -240,6 +249,7 @@ impl Violation for SuspiciousXmlPulldomImport {
|
||||||
///
|
///
|
||||||
/// [deprecated]: https://github.com/tiran/defusedxml/blob/c7445887f5e1bcea470a16f61369d29870cfcfe1/README.md#defusedxmllxml
|
/// [deprecated]: https://github.com/tiran/defusedxml/blob/c7445887f5e1bcea470a16f61369d29870cfcfe1/README.md#defusedxmllxml
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(removed_since = "v0.3.0")]
|
||||||
pub(crate) struct SuspiciousLxmlImport;
|
pub(crate) struct SuspiciousLxmlImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousLxmlImport {
|
impl Violation for SuspiciousLxmlImport {
|
||||||
|
|
@ -263,6 +273,7 @@ impl Violation for SuspiciousLxmlImport {
|
||||||
/// import xmlrpc
|
/// import xmlrpc
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousXmlrpcImport;
|
pub(crate) struct SuspiciousXmlrpcImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousXmlrpcImport {
|
impl Violation for SuspiciousXmlrpcImport {
|
||||||
|
|
@ -289,6 +300,7 @@ impl Violation for SuspiciousXmlrpcImport {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [httpoxy website](https://httpoxy.org/)
|
/// - [httpoxy website](https://httpoxy.org/)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousHttpoxyImport;
|
pub(crate) struct SuspiciousHttpoxyImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousHttpoxyImport {
|
impl Violation for SuspiciousHttpoxyImport {
|
||||||
|
|
@ -314,6 +326,7 @@ impl Violation for SuspiciousHttpoxyImport {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Buffer Overflow Issue](https://github.com/pycrypto/pycrypto/issues/176)
|
/// - [Buffer Overflow Issue](https://github.com/pycrypto/pycrypto/issues/176)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousPycryptoImport;
|
pub(crate) struct SuspiciousPycryptoImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousPycryptoImport {
|
impl Violation for SuspiciousPycryptoImport {
|
||||||
|
|
@ -339,6 +352,7 @@ impl Violation for SuspiciousPycryptoImport {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Buffer Overflow Issue](https://github.com/pycrypto/pycrypto/issues/176)
|
/// - [Buffer Overflow Issue](https://github.com/pycrypto/pycrypto/issues/176)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.1.12")]
|
||||||
pub(crate) struct SuspiciousPyghmiImport;
|
pub(crate) struct SuspiciousPyghmiImport;
|
||||||
|
|
||||||
impl Violation for SuspiciousPyghmiImport {
|
impl Violation for SuspiciousPyghmiImport {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ use crate::checkers::ast::Checker;
|
||||||
///
|
///
|
||||||
/// [PEP 706]: https://peps.python.org/pep-0706/#backporting-forward-compatibility
|
/// [PEP 706]: https://peps.python.org/pep-0706/#backporting-forward-compatibility
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct TarfileUnsafeMembers;
|
pub(crate) struct TarfileUnsafeMembers;
|
||||||
|
|
||||||
impl Violation for TarfileUnsafeMembers {
|
impl Violation for TarfileUnsafeMembers {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ use crate::rules::flake8_bandit::helpers::is_untyped_exception;
|
||||||
/// - [Common Weakness Enumeration: CWE-703](https://cwe.mitre.org/data/definitions/703.html)
|
/// - [Common Weakness Enumeration: CWE-703](https://cwe.mitre.org/data/definitions/703.html)
|
||||||
/// - [Python documentation: `logging`](https://docs.python.org/3/library/logging.html)
|
/// - [Python documentation: `logging`](https://docs.python.org/3/library/logging.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.245")]
|
||||||
pub(crate) struct TryExceptContinue;
|
pub(crate) struct TryExceptContinue;
|
||||||
|
|
||||||
impl Violation for TryExceptContinue {
|
impl Violation for TryExceptContinue {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use crate::rules::flake8_bandit::helpers::is_untyped_exception;
|
||||||
/// - [Common Weakness Enumeration: CWE-703](https://cwe.mitre.org/data/definitions/703.html)
|
/// - [Common Weakness Enumeration: CWE-703](https://cwe.mitre.org/data/definitions/703.html)
|
||||||
/// - [Python documentation: `logging`](https://docs.python.org/3/library/logging.html)
|
/// - [Python documentation: `logging`](https://docs.python.org/3/library/logging.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.237")]
|
||||||
pub(crate) struct TryExceptPass;
|
pub(crate) struct TryExceptPass;
|
||||||
|
|
||||||
impl Violation for TryExceptPass {
|
impl Violation for TryExceptPass {
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ use crate::{checkers::ast::Checker, settings::LinterSettings};
|
||||||
/// [markupsafe-markup]: https://markupsafe.palletsprojects.com/en/stable/escaping/#markupsafe.Markup
|
/// [markupsafe-markup]: https://markupsafe.palletsprojects.com/en/stable/escaping/#markupsafe.Markup
|
||||||
/// [flake8-markupsafe]: https://github.com/vmagamedov/flake8-markupsafe
|
/// [flake8-markupsafe]: https://github.com/vmagamedov/flake8-markupsafe
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.10.0")]
|
||||||
pub(crate) struct UnsafeMarkupUse {
|
pub(crate) struct UnsafeMarkupUse {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [PyYAML documentation: Loading YAML](https://pyyaml.org/wiki/PyYAMLDocumentation)
|
/// - [PyYAML documentation: Loading YAML](https://pyyaml.org/wiki/PyYAMLDocumentation)
|
||||||
/// - [Common Weakness Enumeration: CWE-20](https://cwe.mitre.org/data/definitions/20.html)
|
/// - [Common Weakness Enumeration: CWE-20](https://cwe.mitre.org/data/definitions/20.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.212")]
|
||||||
pub(crate) struct UnsafeYAMLLoad {
|
pub(crate) struct UnsafeYAMLLoad {
|
||||||
pub loader: Option<String>,
|
pub loader: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [CSRC: Transitioning the Use of Cryptographic Algorithms and Key Lengths](https://csrc.nist.gov/pubs/sp/800/131/a/r2/final)
|
/// - [CSRC: Transitioning the Use of Cryptographic Algorithms and Key Lengths](https://csrc.nist.gov/pubs/sp/800/131/a/r2/final)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.2.0")]
|
||||||
pub(crate) struct WeakCryptographicKey {
|
pub(crate) struct WeakCryptographicKey {
|
||||||
cryptographic_key: CryptographicKey,
|
cryptographic_key: CryptographicKey,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
||||||
/// - [PEP 8: Programming Recommendations on bare `except`](https://peps.python.org/pep-0008/#programming-recommendations)
|
/// - [PEP 8: Programming Recommendations on bare `except`](https://peps.python.org/pep-0008/#programming-recommendations)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.127")]
|
||||||
pub(crate) struct BlindExcept {
|
pub(crate) struct BlindExcept {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ use crate::rules::flake8_boolean_trap::helpers::is_allowed_func_def;
|
||||||
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
||||||
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.127")]
|
||||||
pub(crate) struct BooleanDefaultValuePositionalArgument;
|
pub(crate) struct BooleanDefaultValuePositionalArgument;
|
||||||
|
|
||||||
impl Violation for BooleanDefaultValuePositionalArgument {
|
impl Violation for BooleanDefaultValuePositionalArgument {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ use crate::rules::flake8_boolean_trap::helpers::allow_boolean_trap;
|
||||||
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
||||||
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.127")]
|
||||||
pub(crate) struct BooleanPositionalValueInCall;
|
pub(crate) struct BooleanPositionalValueInCall;
|
||||||
|
|
||||||
impl Violation for BooleanPositionalValueInCall {
|
impl Violation for BooleanPositionalValueInCall {
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ use crate::rules::flake8_boolean_trap::helpers::is_allowed_func_def;
|
||||||
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
/// - [Python documentation: Calls](https://docs.python.org/3/reference/expressions.html#calls)
|
||||||
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
/// - [_How to Avoid “The Boolean Trap”_ by Adam Johnson](https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.127")]
|
||||||
pub(crate) struct BooleanTypeHintPositionalArgument;
|
pub(crate) struct BooleanTypeHintPositionalArgument;
|
||||||
|
|
||||||
impl Violation for BooleanTypeHintPositionalArgument {
|
impl Violation for BooleanTypeHintPositionalArgument {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ use crate::registry::Rule;
|
||||||
/// - [Python documentation: `abc`](https://docs.python.org/3/library/abc.html)
|
/// - [Python documentation: `abc`](https://docs.python.org/3/library/abc.html)
|
||||||
/// - [Python documentation: `typing.ClassVar`](https://docs.python.org/3/library/typing.html#typing.ClassVar)
|
/// - [Python documentation: `typing.ClassVar`](https://docs.python.org/3/library/typing.html#typing.ClassVar)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.118")]
|
||||||
pub(crate) struct AbstractBaseClassWithoutAbstractMethod {
|
pub(crate) struct AbstractBaseClassWithoutAbstractMethod {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +100,7 @@ impl Violation for AbstractBaseClassWithoutAbstractMethod {
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `abc`](https://docs.python.org/3/library/abc.html)
|
/// - [Python documentation: `abc`](https://docs.python.org/3/library/abc.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.118")]
|
||||||
pub(crate) struct EmptyMethodWithoutAbstractDecorator {
|
pub(crate) struct EmptyMethodWithoutAbstractDecorator {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `assert`](https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement)
|
/// - [Python documentation: `assert`](https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.67")]
|
||||||
pub(crate) struct AssertFalse;
|
pub(crate) struct AssertFalse;
|
||||||
|
|
||||||
impl AlwaysFixableViolation for AssertFalse {
|
impl AlwaysFixableViolation for AssertFalse {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// self.assertRaises(SomeSpecificException, foo)
|
/// self.assertRaises(SomeSpecificException, foo)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.83")]
|
||||||
pub(crate) struct AssertRaisesException {
|
pub(crate) struct AssertRaisesException {
|
||||||
exception: ExceptionKind,
|
exception: ExceptionKind,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `os.environ`](https://docs.python.org/3/library/os.html#os.environ)
|
/// - [Python documentation: `os.environ`](https://docs.python.org/3/library/os.html#os.environ)
|
||||||
/// - [Python documentation: `subprocess.Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen)
|
/// - [Python documentation: `subprocess.Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.102")]
|
||||||
pub(crate) struct AssignmentToOsEnviron;
|
pub(crate) struct AssignmentToOsEnviron;
|
||||||
|
|
||||||
impl Violation for AssignmentToOsEnviron {
|
impl Violation for AssignmentToOsEnviron {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ use crate::{FixAvailability, Violation};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `batched`](https://docs.python.org/3/library/itertools.html#batched)
|
/// - [Python documentation: `batched`](https://docs.python.org/3/library/itertools.html#batched)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.10.0")]
|
||||||
pub(crate) struct BatchedWithoutExplicitStrict;
|
pub(crate) struct BatchedWithoutExplicitStrict;
|
||||||
|
|
||||||
impl Violation for BatchedWithoutExplicitStrict {
|
impl Violation for BatchedWithoutExplicitStrict {
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `functools.cache`](https://docs.python.org/3/library/functools.html#functools.cache)
|
/// - [Python documentation: `functools.cache`](https://docs.python.org/3/library/functools.html#functools.cache)
|
||||||
/// - [don't lru_cache methods!](https://www.youtube.com/watch?v=sVjtp6tGo0g)
|
/// - [don't lru_cache methods!](https://www.youtube.com/watch?v=sVjtp6tGo0g)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.114")]
|
||||||
pub(crate) struct CachedInstanceMethod;
|
pub(crate) struct CachedInstanceMethod;
|
||||||
|
|
||||||
impl Violation for CachedInstanceMethod {
|
impl Violation for CachedInstanceMethod {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use ruff_python_ast::PythonVersion;
|
||||||
/// y: float
|
/// y: float
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "0.9.0")]
|
||||||
pub(crate) struct ClassAsDataStructure;
|
pub(crate) struct ClassAsDataStructure;
|
||||||
|
|
||||||
impl Violation for ClassAsDataStructure {
|
impl Violation for ClassAsDataStructure {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ use crate::{Edit, Fix};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.67")]
|
||||||
pub(crate) struct DuplicateTryBlockException {
|
pub(crate) struct DuplicateTryBlockException {
|
||||||
name: String,
|
name: String,
|
||||||
is_star: bool,
|
is_star: bool,
|
||||||
|
|
@ -87,6 +88,7 @@ impl Violation for DuplicateTryBlockException {
|
||||||
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
||||||
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.67")]
|
||||||
pub(crate) struct DuplicateHandlerException {
|
pub(crate) struct DuplicateHandlerException {
|
||||||
pub names: Vec<String>,
|
pub names: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ use crate::{Edit, Fix, FixAvailability, Violation};
|
||||||
/// {1, 2, 3}
|
/// {1, 2, 3}
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.271")]
|
||||||
pub(crate) struct DuplicateValue {
|
pub(crate) struct DuplicateValue {
|
||||||
value: String,
|
value: String,
|
||||||
existing: String,
|
existing: String,
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.250")]
|
||||||
pub(crate) struct ExceptWithEmptyTuple {
|
pub(crate) struct ExceptWithEmptyTuple {
|
||||||
is_star: bool,
|
is_star: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
||||||
/// - [Python documentation: Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#built-in-exceptions)
|
/// - [Python documentation: Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#built-in-exceptions)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.255")]
|
||||||
pub(crate) struct ExceptWithNonExceptionClasses {
|
pub(crate) struct ExceptWithNonExceptionClasses {
|
||||||
is_star: bool,
|
is_star: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257/)
|
/// - [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257/)
|
||||||
/// - [Python documentation: Formatted string literals](https://docs.python.org/3/reference/lexical_analysis.html#f-strings)
|
/// - [Python documentation: Formatted string literals](https://docs.python.org/3/reference/lexical_analysis.html#f-strings)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct FStringDocstring;
|
pub(crate) struct FStringDocstring;
|
||||||
|
|
||||||
impl Violation for FStringDocstring {
|
impl Violation for FStringDocstring {
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## Options
|
/// ## Options
|
||||||
/// - `lint.flake8-bugbear.extend-immutable-calls`
|
/// - `lint.flake8-bugbear.extend-immutable-calls`
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.102")]
|
||||||
pub(crate) struct FunctionCallInDefaultArgument {
|
pub(crate) struct FunctionCallInDefaultArgument {
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [The Hitchhiker's Guide to Python: Late Binding Closures](https://docs.python-guide.org/writing/gotchas/#late-binding-closures)
|
/// - [The Hitchhiker's Guide to Python: Late Binding Closures](https://docs.python-guide.org/writing/gotchas/#late-binding-closures)
|
||||||
/// - [Python documentation: `functools.partial`](https://docs.python.org/3/library/functools.html#functools.partial)
|
/// - [Python documentation: `functools.partial`](https://docs.python.org/3/library/functools.html#functools.partial)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.139")]
|
||||||
pub(crate) struct FunctionUsesLoopVariable {
|
pub(crate) struct FunctionUsesLoopVariable {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `getattr`](https://docs.python.org/3/library/functions.html#getattr)
|
/// - [Python documentation: `getattr`](https://docs.python.org/3/library/functions.html#getattr)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.110")]
|
||||||
pub(crate) struct GetAttrWithConstant;
|
pub(crate) struct GetAttrWithConstant;
|
||||||
|
|
||||||
impl AlwaysFixableViolation for GetAttrWithConstant {
|
impl AlwaysFixableViolation for GetAttrWithConstant {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: The `try` statement](https://docs.python.org/3/reference/compound_stmts.html#the-try-statement)
|
/// - [Python documentation: The `try` statement](https://docs.python.org/3/reference/compound_stmts.html#the-try-statement)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.116")]
|
||||||
pub(crate) struct JumpStatementInFinally {
|
pub(crate) struct JumpStatementInFinally {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ use crate::fix::snippet::SourceCodeSnippet;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: Mutable Sequence Types](https://docs.python.org/3/library/stdtypes.html#typesseq-mutable)
|
/// - [Python documentation: Mutable Sequence Types](https://docs.python.org/3/library/stdtypes.html#typesseq-mutable)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.3.7")]
|
||||||
pub(crate) struct LoopIteratorMutation {
|
pub(crate) struct LoopIteratorMutation {
|
||||||
name: Option<SourceCodeSnippet>,
|
name: Option<SourceCodeSnippet>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: The `for` statement](https://docs.python.org/3/reference/compound_stmts.html#the-for-statement)
|
/// - [Python documentation: The `for` statement](https://docs.python.org/3/reference/compound_stmts.html#the-for-statement)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.121")]
|
||||||
pub(crate) struct LoopVariableOverridesIterator {
|
pub(crate) struct LoopVariableOverridesIterator {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ use crate::{AlwaysFixableViolation, Applicability, Fix};
|
||||||
/// - [Python documentation: `map`](https://docs.python.org/3/library/functions.html#map)
|
/// - [Python documentation: `map`](https://docs.python.org/3/library/functions.html#map)
|
||||||
/// - [What’s New in Python 3.14](https://docs.python.org/dev/whatsnew/3.14.html)
|
/// - [What’s New in Python 3.14](https://docs.python.org/dev/whatsnew/3.14.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "0.13.2")]
|
||||||
pub(crate) struct MapWithoutExplicitStrict;
|
pub(crate) struct MapWithoutExplicitStrict;
|
||||||
|
|
||||||
impl AlwaysFixableViolation for MapWithoutExplicitStrict {
|
impl AlwaysFixableViolation for MapWithoutExplicitStrict {
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ use crate::{Edit, Fix, FixAvailability, Violation};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: Default Argument Values](https://docs.python.org/3/tutorial/controlflow.html#default-argument-values)
|
/// - [Python documentation: Default Argument Values](https://docs.python.org/3/tutorial/controlflow.html#default-argument-values)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.92")]
|
||||||
pub(crate) struct MutableArgumentDefault;
|
pub(crate) struct MutableArgumentDefault;
|
||||||
|
|
||||||
impl Violation for MutableArgumentDefault {
|
impl Violation for MutableArgumentDefault {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `contextvars` — Context Variables](https://docs.python.org/3/library/contextvars.html)
|
/// - [Python documentation: `contextvars` — Context Variables](https://docs.python.org/3/library/contextvars.html)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "0.8.0")]
|
||||||
pub(crate) struct MutableContextvarDefault;
|
pub(crate) struct MutableContextvarDefault;
|
||||||
|
|
||||||
impl Violation for MutableContextvarDefault {
|
impl Violation for MutableContextvarDefault {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ use crate::{checkers::ast::Checker, fix::edits::add_argument};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `warnings.warn`](https://docs.python.org/3/library/warnings.html#warnings.warn)
|
/// - [Python documentation: `warnings.warn`](https://docs.python.org/3/library/warnings.html#warnings.warn)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.257")]
|
||||||
pub(crate) struct NoExplicitStacklevel;
|
pub(crate) struct NoExplicitStacklevel;
|
||||||
|
|
||||||
impl AlwaysFixableViolation for NoExplicitStacklevel {
|
impl AlwaysFixableViolation for NoExplicitStacklevel {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `raise` statement](https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement)
|
/// - [Python documentation: `raise` statement](https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.102")]
|
||||||
pub(crate) struct RaiseLiteral;
|
pub(crate) struct RaiseLiteral;
|
||||||
|
|
||||||
impl Violation for RaiseLiteral {
|
impl Violation for RaiseLiteral {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `raise` statement](https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement)
|
/// - [Python documentation: `raise` statement](https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.138")]
|
||||||
pub(crate) struct RaiseWithoutFromInsideExcept {
|
pub(crate) struct RaiseWithoutFromInsideExcept {
|
||||||
is_star: bool,
|
is_star: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// - [Python documentation: `re.subn`](https://docs.python.org/3/library/re.html#re.subn)
|
/// - [Python documentation: `re.subn`](https://docs.python.org/3/library/re.html#re.subn)
|
||||||
/// - [Python documentation: `re.split`](https://docs.python.org/3/library/re.html#re.split)
|
/// - [Python documentation: `re.split`](https://docs.python.org/3/library/re.html#re.split)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.278")]
|
||||||
pub(crate) struct ReSubPositionalArgs {
|
pub(crate) struct ReSubPositionalArgs {
|
||||||
method: Method,
|
method: Method,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
/// - [Python documentation: `except` clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(stable_since = "v0.0.89")]
|
||||||
pub(crate) struct RedundantTupleInExceptionHandler {
|
pub(crate) struct RedundantTupleInExceptionHandler {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// yield from dir_path.glob(f"*.{file_type}")
|
/// yield from dir_path.glob(f"*.{file_type}")
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
|
#[violation_metadata(preview_since = "v0.4.8")]
|
||||||
pub(crate) struct ReturnInGenerator;
|
pub(crate) struct ReturnInGenerator;
|
||||||
|
|
||||||
impl Violation for ReturnInGenerator {
|
impl Violation for ReturnInGenerator {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue