mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1713683 - Run setup
function with lintargs
including log and virtual env binary path. r=ahal
This was oversight from Bug 1713178, which made black's `setup` function require them but didn't bump the test. Differential Revision: https://phabricator.services.mozilla.com/D116493
This commit is contained in:
parent
789bc7cc92
commit
16ab993262
@ -114,11 +114,10 @@ def setup(root, **lintargs):
|
||||
log = lintargs["log"]
|
||||
virtualenv_bin_path = lintargs.get("virtualenv_bin_path")
|
||||
# Using `which` searches multiple directories and handles `.exe` on Windows.
|
||||
binary = mozpath.normsep(
|
||||
which("black", path=(virtualenv_bin_path, default_bindir()))
|
||||
)
|
||||
binary = which("black", path=(virtualenv_bin_path, default_bindir()))
|
||||
|
||||
if binary and os.path.exists(binary):
|
||||
binary = mozpath.normsep(binary)
|
||||
log.debug("Looking for black at {}".format(binary))
|
||||
version = get_black_version(binary)
|
||||
versions = [
|
||||
|
@ -93,8 +93,17 @@ def run_setup(config):
|
||||
if "setup" not in config:
|
||||
return
|
||||
|
||||
log = logging.LoggerAdapter(
|
||||
logger, {"lintname": config.get("name"), "pid": os.getpid()}
|
||||
)
|
||||
|
||||
func = findobject(config["setup"])
|
||||
func(build.topsrcdir, virtualenv_manager=build.virtualenv_manager)
|
||||
func(
|
||||
build.topsrcdir,
|
||||
virtualenv_manager=build.virtualenv_manager,
|
||||
virtualenv_bin_path=build.virtualenv_manager.bin_path,
|
||||
log=log,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
Loading…
Reference in New Issue
Block a user