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:
@@ -10,13 +10,11 @@
|
|||||||
|
|
||||||
# trunk-ignore-all(ruff/F821)
|
# trunk-ignore-all(ruff/F821)
|
||||||
# trunk-ignore-all(flake8/F821): Import/env/Return are SCons-injected globals
|
# 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 glob
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
Import("env")
|
||||||
|
|
||||||
framework_dir = env.PioPlatform().get_package_dir("framework-arduinopico")
|
framework_dir = env.PioPlatform().get_package_dir("framework-arduinopico")
|
||||||
if not framework_dir:
|
if not framework_dir:
|
||||||
print("[add_mbedtls_sources] framework-arduinopico package not found - skipping")
|
print("[add_mbedtls_sources] framework-arduinopico package not found - skipping")
|
||||||
|
|||||||
Reference in New Issue
Block a user