ruff/crates/ruff_linter/src
GiGaGon ed2e90371b
[flake8-async] Make ASYNC210 example error out-of-the-box (#18977)
## Summary

Part of #18972

This PR makes [blocking-http-call-in-async-function
(ASYNC210)](https://docs.astral.sh/ruff/rules/blocking-http-call-in-async-function/#blocking-http-call-in-async-function-async210)'s
example error out-of-the-box

[Old example](https://play.ruff.rs/20cba4f4-fe2f-428a-a721-311d1a081e64)
```py
async def fetch():
    urllib.request.urlopen("https://example.com/foo/bar").read()
```

[New example](https://play.ruff.rs/5ca2a10d-5294-49ee-baee-0447f7188d9b)
```py
import urllib


async def fetch():
    urllib.request.urlopen("https://example.com/foo/bar").read()
```

## Test Plan

<!-- How was it tested? -->

N/A, no functionality/tests affected
2025-06-28 10:11:38 -05:00
..
checkers [flake8-pyi] Expand Optional[A] to A | None (PYI016) (#18572) 2025-06-27 15:43:11 +00:00
comments
cst [ruff] Fix false positives and negatives in RUF010 (#18690) 2025-06-26 17:53:52 +02:00
docstrings [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
fix Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
importer [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
linter [pylint] Detect more exotic NaN literals in PLW0177 (#18630) 2025-06-19 11:05:06 +00:00
message Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
registry Remove Message::to_rule (#18447) 2025-06-05 12:48:29 -04:00
rules [flake8-async] Make ASYNC210 example error out-of-the-box (#18977) 2025-06-28 10:11:38 -05:00
settings Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
snapshots [semantic-syntax-tests] IrrefutableCasePattern, SingleStarredAssignment, WriteToDebug, InvalidExpression (#17748) 2025-05-09 14:54:05 -04:00
codes.rs Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
directives.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
doc_lines.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
fs.rs Avoid generating diagnostics with per-file ignores (#18801) 2025-06-20 13:33:09 -04:00
lib.rs Unify OldDiagnostic and Message (#18391) 2025-06-19 09:37:58 -04:00
line_width.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
linter.rs Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
locator.rs Split SourceLocation into LineColumn and SourceLocation (#17587) 2025-04-27 11:27:33 +01:00
logging.rs Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
noqa.rs Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
package.rs
packaging.rs
preview.rs [flake8-pyi] Expand Optional[A] to A | None (PYI016) (#18572) 2025-06-27 15:43:11 +00:00
pyproject_toml.rs Add missing rule code comments (#18906) 2025-06-24 21:18:57 -04:00
registry.rs Apply fix availability and applicability when adding to DiagnosticGuard and remove NoqaCode::rule (#18834) 2025-06-24 10:08:36 -04:00
renamer.rs Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
rule_redirects.rs
rule_selector.rs Apply fix availability and applicability when adding to DiagnosticGuard and remove NoqaCode::rule (#18834) 2025-06-24 10:08:36 -04:00
source_kind.rs Update MSRV to 1.85 and toolchain to 1.87 (#18126) 2025-05-16 09:19:55 +02:00
test.rs Convert OldDiagnostic::noqa_code to an Option<String> (#18946) 2025-06-27 11:36:55 -04:00
text_helpers.rs
upstream_categories.rs
violation.rs Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00