From 6be7d9ceeb0300a30b6ae7c92c92b25d334b2696 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Sun, 26 Jul 2026 07:32:54 +0200 Subject: [PATCH] lint: hoist stdlib imports above Import(env) in add_mbedtls_sources (#11172) glob and os do not depend on the SCons-injected env, so importing them at the top of the file removes the flake8 E402 findings and lets the E402 ignore-all directives (which were no longer suppressing anything) go away. --- scripts/add_mbedtls_sources.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/add_mbedtls_sources.py b/scripts/add_mbedtls_sources.py index 2b6a0149a5..98027c2e64 100644 --- a/scripts/add_mbedtls_sources.py +++ b/scripts/add_mbedtls_sources.py @@ -10,13 +10,11 @@ # trunk-ignore-all(ruff/F821) # trunk-ignore-all(flake8/F821): Import/env/Return are SCons-injected globals -# trunk-ignore-all(ruff/E402) -# trunk-ignore-all(flake8/E402): stdlib imports must follow Import("env") -Import("env") - import glob import os +Import("env") + framework_dir = env.PioPlatform().get_package_dir("framework-arduinopico") if not framework_dir: print("[add_mbedtls_sources] framework-arduinopico package not found - skipping")