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.
This commit is contained in:
Jorropo
2026-07-26 07:32:54 +02:00
committed by GitHub
parent e700cc7a8c
commit 6be7d9ceeb

View File

@@ -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")