Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ mod tests {
#[test_case(Rule::LoopIteratorMutation, Path::new("B909.py"))]
#[test_case(Rule::MutableContextvarDefault, Path::new("B039.py"))]
#[test_case(Rule::BatchedWithoutExplicitStrict, Path::new("B911.py"))]
#[test_case(Rule::MapWithoutExplicitStrict, Path::new("B912.py"))]
fn rules(rule_code: Rule, path: &Path) -> Result<()> {
let snapshot = format!("{}_{}", rule_code.noqa_code(), path.to_string_lossy());
let diagnostics = test_path(
Expand All @@ -83,7 +84,6 @@ mod tests {
Ok(())
}

#[test_case(Rule::MapWithoutExplicitStrict, Path::new("B912.py"))]
#[test_case(Rule::MutableArgumentDefault, Path::new("B006_1.py"))]
#[test_case(Rule::MutableArgumentDefault, Path::new("B006_2.py"))]
#[test_case(Rule::MutableArgumentDefault, Path::new("B006_3.py"))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ use crate::rules::flake8_bugbear::helpers::any_infinite_iterables;
use crate::{AlwaysFixableViolation, Applicability, Fix};

/// ## What it does
/// Checks for `map` calls without an explicit `strict` parameter when called with two or more iterables, or any starred argument.
/// Checks for `map` calls without an explicit `strict` parameter when called with two or more
/// iterables, or any starred argument.
///
/// This rule applies to Python 3.14 and later, where `map` accepts a `strict` keyword
/// argument. For details, see: [What’s New in Python 3.14](https://docs.python.org/dev/whatsnew/3.14.html).
/// argument. For details, see: [What’s New in Python 3.14].
///
/// ## Why is this bad?
/// By default, if the iterables passed to `map` are of different lengths, the
Expand Down Expand Up @@ -41,9 +42,11 @@ use crate::{AlwaysFixableViolation, Applicability, Fix};
///
/// ## References
/// - [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]
///
/// [What's New in Python 3.14]: https://docs.python.org/dev/whatsnew/3.14.html
#[derive(ViolationMetadata)]
#[violation_metadata(preview_since = "0.13.2")]
#[violation_metadata(stable_since = "0.15.0")]
pub(crate) struct MapWithoutExplicitStrict;

impl AlwaysFixableViolation for MapWithoutExplicitStrict {
Expand Down