From 466021d5e1793ca30e0d860cb1cd27e32f5233aa Mon Sep 17 00:00:00 2001 From: Vasco Schiavo <115561717+VascoSch92@users.noreply.github.com> Date: Wed, 14 May 2025 23:16:20 +0200 Subject: [PATCH] [`flake8-simplify`] add fix safety section (`SIM112`) (#18099) The PR add the `fix safety` section for rule `SIM112` (#15584 ). --- .../ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs index 5131b6ad0f..6a3f24fe6a 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs +++ b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs @@ -32,6 +32,12 @@ use crate::checkers::ast::Checker; /// os.environ["FOO"] /// ``` /// +/// ## Fix safety +/// +/// This fix is always marked as unsafe because automatically capitalizing environment variable names +/// can change program behavior in environments where the variable names are case-sensitive, such as most +/// Unix-like systems. +/// /// ## References /// - [Python documentation: `os.environ`](https://docs.python.org/3/library/os.html#os.environ) #[derive(ViolationMetadata)]