From 7154b64248e7d42f277d892f347527a7ec1410d6 Mon Sep 17 00:00:00 2001 From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:08:47 -0700 Subject: [PATCH] [`pylint`] Make example error out-of-the-box (`PLE1507`) (#19288) ## Summary Part of #18972 This PR makes [invalid-envvar-value (PLE1507)](https://docs.astral.sh/ruff/rules/invalid-envvar-value/#invalid-envvar-value-ple1507)'s example error out-of-the-box. [Old example](https://play.ruff.rs/a46a9bca-edd5-4474-b20d-e6b6d87291ca) ```py os.getenv(1) ``` [New example](https://play.ruff.rs/8348d32d-71fa-422c-b228-e2bc343765b1) ```py import os os.getenv(1) ``` The "Use instead" section was also updated similarly. ## Test Plan N/A, no functionality/tests affected --- .../src/rules/pylint/rules/invalid_envvar_value.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ruff_linter/src/rules/pylint/rules/invalid_envvar_value.rs b/crates/ruff_linter/src/rules/pylint/rules/invalid_envvar_value.rs index 7a2e1e3e0f..9a986e41d7 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/invalid_envvar_value.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/invalid_envvar_value.rs @@ -18,11 +18,15 @@ use crate::checkers::ast::Checker; /// /// ## Example /// ```python +/// import os +/// /// os.getenv(1) /// ``` /// /// Use instead: /// ```python +/// import os +/// /// os.getenv("1") /// ``` #[derive(ViolationMetadata)]